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

Method __init__

Lib/multiprocessing/queues.py:35–53  ·  view source on GitHub ↗
(self, maxsize=0, *, ctx)

Source from the content-addressed store, hash-verified

33class Queue(object):
34
35 def __init__(self, maxsize=0, *, ctx):
36 if maxsize <= 0:
37 # Can raise ImportError (see issues #3770 and #23400)
38 from .synchronize import SEM_VALUE_MAX as maxsize
39 self._maxsize = maxsize
40 self._reader, self._writer = connection.Pipe(duplex=False)
41 self._rlock = ctx.Lock()
42 self._opid = os.getpid()
43 if sys.platform == 'win32':
44 self._wlock = None
45 else:
46 self._wlock = ctx.Lock()
47 self._sem = ctx.BoundedSemaphore(maxsize)
48 # For use by concurrent.futures
49 self._ignore_epipe = False
50 self._reset()
51
52 if sys.platform != 'win32':
53 register_after_fork(self, Queue._after_fork)
54
55 def __getstate__(self):
56 context.assert_spawning(self)

Callers 1

__init__Method · 0.45

Calls 5

_resetMethod · 0.95
register_after_forkFunction · 0.85
PipeMethod · 0.80
LockMethod · 0.80
BoundedSemaphoreMethod · 0.80

Tested by

no test coverage detected