MCPcopy Index your code
hub / github.com/python/cpython / __getstate__

Method __getstate__

Lib/multiprocessing/synchronize.py:102–114  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

100 return self._semlock.__exit__(*args)
101
102 def __getstate__(self):
103 context.assert_spawning(self)
104 sl = self._semlock
105 if sys.platform == 'win32':
106 h = context.get_spawning_popen().duplicate_for_child(sl.handle)
107 else:
108 if self._is_fork_ctx:
109 raise RuntimeError('A SemLock created in a fork context is being '
110 'shared with a process in a spawn context. This is '
111 'not supported. Please use the same context to create '
112 'multiprocessing objects and Process.')
113 h = sl.handle
114 return (h, sl.kind, sl.maxvalue, sl.name)
115
116 def __setstate__(self, state):
117 self._semlock = _multiprocessing.SemLock._rebuild(*state)

Callers

nothing calls this directly

Calls 1

duplicate_for_childMethod · 0.45

Tested by

no test coverage detected