当前位置: 首页>>代码示例>>Python>>正文


Python os.wait3方法代码示例

本文整理汇总了Python中os.wait3方法的典型用法代码示例。如果您正苦于以下问题:Python os.wait3方法的具体用法?Python os.wait3怎么用?Python os.wait3使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在os的用法示例。


在下文中一共展示了os.wait3方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: wait_impl

# 需要导入模块: import os [as 别名]
# 或者: from os import wait3 [as 别名]
def wait_impl(self, cpid):
        # This many iterations can be required, since some previously run
        # tests (e.g. test_ctypes) could have spawned a lot of children
        # very quickly.
        deadline = time.monotonic() + 10.0
        while time.monotonic() <= deadline:
            # wait3() shouldn't hang, but some of the buildbots seem to hang
            # in the forking tests.  This is an attempt to fix the problem.
            spid, status, rusage = os.wait3(os.WNOHANG)
            if spid == cpid:
                break
            time.sleep(0.1)

        self.assertEqual(spid, cpid)
        self.assertEqual(status, 0, "cause = %d, exit = %d" % (status&0xff, status>>8))
        self.assertTrue(rusage) 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:18,代码来源:test_wait3.py

示例2: wait_impl

# 需要导入模块: import os [as 别名]
# 或者: from os import wait3 [as 别名]
def wait_impl(self, cpid):
        for i in range(10):
            # wait3() shouldn't hang, but some of the buildbots seem to hang
            # in the forking tests.  This is an attempt to fix the problem.
            spid, status, rusage = os.wait3(os.WNOHANG)
            if spid == cpid:
                break
            time.sleep(1.0)

        self.assertEqual(spid, cpid)
        self.assertEqual(status, 0, "cause = %d, exit = %d" % (status&0xff, status>>8))
        self.assertTrue(rusage) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:14,代码来源:test_wait3.py

示例3: test_wait3

# 需要导入模块: import os [as 别名]
# 或者: from os import wait3 [as 别名]
def test_wait3(self):
        self._test_wait_multiple(lambda: os.wait3(0)) 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:4,代码来源:eintr_tester.py

示例4: wait_impl

# 需要导入模块: import os [as 别名]
# 或者: from os import wait3 [as 别名]
def wait_impl(self, cpid):
        # This many iterations can be required, since some previously run
        # tests (e.g. test_ctypes) could have spawned a lot of children
        # very quickly.
        for i in range(30):
            # wait3() shouldn't hang, but some of the buildbots seem to hang
            # in the forking tests.  This is an attempt to fix the problem.
            spid, status, rusage = os.wait3(os.WNOHANG)
            if spid == cpid:
                break
            time.sleep(0.1)

        self.assertEqual(spid, cpid)
        self.assertEqual(status, 0, "cause = %d, exit = %d" % (status&0xff, status>>8))
        self.assertTrue(rusage) 
开发者ID:IronLanguages,项目名称:ironpython3,代码行数:17,代码来源:test_wait3.py


注:本文中的os.wait3方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。