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

Method stop

Lib/multiprocessing/resource_sharer.py:90–109  ·  view source on GitHub ↗

Stop the background thread and clear registered resources.

(self, timeout=None)

Source from the content-addressed store, hash-verified

88 return c
89
90 def stop(self, timeout=None):
91 '''Stop the background thread and clear registered resources.'''
92 from .connection import Client
93 with self._lock:
94 if self._address is not None:
95 c = Client(self._address,
96 authkey=process.current_process().authkey)
97 c.send(None)
98 c.close()
99 self._thread.join(timeout)
100 if self._thread.is_alive():
101 util.sub_warning('_ResourceSharer thread did '
102 'not stop when asked')
103 self._listener.close()
104 self._thread = None
105 self._address = None
106 self._listener = None
107 for key, (send, close) in self._cache.items():
108 close()
109 self._cache.clear()
110
111 def _afterfork(self):
112 for key, (send, close) in self._cache.items():

Callers

nothing calls this directly

Calls 8

ClientFunction · 0.70
closeFunction · 0.50
sendMethod · 0.45
closeMethod · 0.45
joinMethod · 0.45
is_aliveMethod · 0.45
itemsMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected