本文整理汇总了Python中multiprocessing.forking.assert_spawning函数的典型用法代码示例。如果您正苦于以下问题:Python assert_spawning函数的具体用法?Python assert_spawning怎么用?Python assert_spawning使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了assert_spawning函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: reduce_ctype
def reduce_ctype(obj):
assert_spawning(obj)
if isinstance(obj, ctypes.Array):
return (rebuild_ctype, (obj._type_, obj._wrapper, obj._length_))
else:
return (rebuild_ctype, (type(obj), obj._wrapper, None))
return None
示例2: __getstate__
def __getstate__(self):
assert_spawning(self)
r = self._reader._semlock
w = self._writer._semlock
reader = Popen.duplicate_for_child(r.handle), r.kind, r.maxvalue
writer = Popen.duplicate_for_child(w.handle), w.kind, w.maxvalue
return (reader, writer)
示例3: __getstate__
def __getstate__(self):
assert_spawning(self)
return (self._maxsize,
self._reader,
self._writer,
self._rlock,
self._wlock,
self._sem,
self._opid)
示例4: __getstate__
def __getstate__(self):
assert_spawning(self)
return (self._reader, self._writer, self._rlock, self._wlock)
示例5: __reduce__
def __reduce__(self):
assert_spawning(self)
return synchronized, (self._obj, self._lock)
示例6: __getstate__
def __getstate__(self):
assert_spawning(self)
return self._state
示例7: __getstate__
def __getstate__(self):
assert_spawning(self)
sl = self._semlock
return (Popen.duplicate_for_child(sl.handle), sl.kind, sl.maxvalue)
示例8: __getstate__
def __getstate__(self):
assert_spawning(self)
return (self._maxsize, int(os.fileNumbers[self._writer.fno].buffer.id),
self._rlock, self._wlock, self._sem, self._opid)