本文整理匯總了Python中multiprocessing.forking.Popen.thread_is_spawning方法的典型用法代碼示例。如果您正苦於以下問題:Python Popen.thread_is_spawning方法的具體用法?Python Popen.thread_is_spawning怎麽用?Python Popen.thread_is_spawning使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類multiprocessing.forking.Popen
的用法示例。
在下文中一共展示了Popen.thread_is_spawning方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: reduce_handle
# 需要導入模塊: from multiprocessing.forking import Popen [as 別名]
# 或者: from multiprocessing.forking.Popen import thread_is_spawning [as 別名]
def reduce_handle(handle):
if Popen.thread_is_spawning():
return (None, Popen.duplicate_for_child(handle), True)
dup_handle = duplicate(handle)
_cache.add(dup_handle)
sub_debug('reducing handle %d', handle)
return (_get_listener().address, dup_handle, False)
示例2: __reduce__
# 需要導入模塊: from multiprocessing.forking import Popen [as 別名]
# 或者: from multiprocessing.forking.Popen import thread_is_spawning [as 別名]
def __reduce__(self):
from multiprocessing.forking import Popen
if not Popen.thread_is_spawning():
raise TypeError(
'Pickling an AuthenticationString object is '
'disallowed for security reasons'
)
return AuthenticationString, (bytes(self),)