Back to index

python3.2  3.2.2
Classes | Functions | Variables
concurrent.futures.thread Namespace Reference

Classes

class  _WorkItem
class  ThreadPoolExecutor

Functions

def _python_exit
def _worker

Variables

string __author__ = 'Brian Quinlan (brian@sweetapp.com)'
tuple _threads_queues = weakref.WeakKeyDictionary()
 _shutdown = False

Function Documentation

Definition at line 31 of file thread.py.

00031 
00032 def _python_exit():
00033     global _shutdown
00034     _shutdown = True
00035     items = list(_threads_queues.items())
00036     for t, q in items:
00037         q.put(None)
00038     for t, q in items:
00039         t.join()
00040 
00041 atexit.register(_python_exit)

def concurrent.futures.thread._worker (   executor_reference,
  work_queue 
) [private]

Definition at line 60 of file thread.py.

00060 
00061 def _worker(executor_reference, work_queue):
00062     try:
00063         while True:
00064             work_item = work_queue.get(block=True)
00065             if work_item is not None:
00066                 work_item.run()
00067                 continue
00068             executor = executor_reference()
00069             # Exit if:
00070             #   - The interpreter is shutting down OR
00071             #   - The executor that owns the worker has been collected OR
00072             #   - The executor that owns the worker has been shutdown.
00073             if _shutdown or executor is None or executor._shutdown:
00074                 # Notice other workers
00075                 work_queue.put(None)
00076                 return
00077             del executor
00078     except BaseException as e:
00079         _base.LOGGER.critical('Exception in worker', exc_info=True)

Here is the caller graph for this function:


Variable Documentation

string concurrent.futures.thread.__author__ = 'Brian Quinlan (brian@sweetapp.com)'

Definition at line 6 of file thread.py.

Definition at line 29 of file thread.py.

Definition at line 28 of file thread.py.