MCPcopy Index your code
hub / github.com/RustPython/RustPython / submit

Method submit

Lib/concurrent/futures/thread.py:165–181  ·  view source on GitHub ↗
(self, fn, /, *args, **kwargs)

Source from the content-addressed store, hash-verified

163 self._initargs = initargs
164
165 def submit(self, fn, /, *args, **kwargs):
166 with self._shutdown_lock, _global_shutdown_lock:
167 if self._broken:
168 raise BrokenThreadPool(self._broken)
169
170 if self._shutdown:
171 raise RuntimeError('cannot schedule new futures after shutdown')
172 if _shutdown:
173 raise RuntimeError('cannot schedule new futures after '
174 'interpreter shutdown')
175
176 f = _base.Future()
177 w = _WorkItem(f, fn, args, kwargs)
178
179 self._work_queue.put(w)
180 self._adjust_thread_count()
181 return f
182 submit.__doc__ = _base.Executor.submit.__doc__
183
184 def _adjust_thread_count(self):

Calls 4

_adjust_thread_countMethod · 0.95
BrokenThreadPoolClass · 0.85
_WorkItemClass · 0.70
putMethod · 0.45