本文整理汇总了Python中_multiprocessing.SemLock._rebuild方法的典型用法代码示例。如果您正苦于以下问题:Python SemLock._rebuild方法的具体用法?Python SemLock._rebuild怎么用?Python SemLock._rebuild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类_multiprocessing.SemLock
的用法示例。
在下文中一共展示了SemLock._rebuild方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_semaphore_rebuild
# 需要导入模块: from _multiprocessing import SemLock [as 别名]
# 或者: from _multiprocessing.SemLock import _rebuild [as 别名]
def test_semaphore_rebuild(self):
from _multiprocessing import SemLock
kind = self.SEMAPHORE
value = 1
maxvalue = 1
sem = SemLock(kind, value, maxvalue)
sem2 = SemLock._rebuild(sem.handle, kind, value)
assert sem.handle == sem2.handle
示例2: __setstate__
# 需要导入模块: from _multiprocessing import SemLock [as 别名]
# 或者: from _multiprocessing.SemLock import _rebuild [as 别名]
def __setstate__(self, state):
self._semlock = _SemLock._rebuild(*state)
util.debug('recreated blocker with handle %r and name "%s"'
% (state[0], state[3]))
self._make_methods()
示例3: __setstate__
# 需要导入模块: from _multiprocessing import SemLock [as 别名]
# 或者: from _multiprocessing.SemLock import _rebuild [as 别名]
def __setstate__(self, state):
reader, writer = state
self._reader = SemLock._rebuild(*reader)
self._writer = SemLock._rebuild(*writer)