|
|
@ -2185,7 +2185,7 @@ class Waker(BasicStream):
|
|
|
|
:raises mitogen.core.Error:
|
|
|
|
:raises mitogen.core.Error:
|
|
|
|
:meth:`defer` was called after :class:`Broker` has begun shutdown.
|
|
|
|
:meth:`defer` was called after :class:`Broker` has begun shutdown.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
if threading.currentThread().ident == self.broker_ident:
|
|
|
|
if thread.get_ident() == self.broker_ident:
|
|
|
|
_vv and IOLOG.debug('%r.defer() [immediate]', self)
|
|
|
|
_vv and IOLOG.debug('%r.defer() [immediate]', self)
|
|
|
|
return func(*args, **kwargs)
|
|
|
|
return func(*args, **kwargs)
|
|
|
|
if self._broker._exitted:
|
|
|
|
if self._broker._exitted:
|
|
|
@ -2631,7 +2631,6 @@ class Broker(object):
|
|
|
|
name='mitogen-broker'
|
|
|
|
name='mitogen-broker'
|
|
|
|
)
|
|
|
|
)
|
|
|
|
self._thread.start()
|
|
|
|
self._thread.start()
|
|
|
|
self._waker.broker_ident = self._thread.ident
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def start_receive(self, stream):
|
|
|
|
def start_receive(self, stream):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
@ -2766,6 +2765,8 @@ class Broker(object):
|
|
|
|
Broker thread main function. Dispatches IO events until
|
|
|
|
Broker thread main function. Dispatches IO events until
|
|
|
|
:meth:`shutdown` is called.
|
|
|
|
:meth:`shutdown` is called.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
|
|
|
|
# For Python 2.4, no way to retrieve ident except on thread.
|
|
|
|
|
|
|
|
self._waker.broker_ident = thread.get_ident()
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
while self._alive:
|
|
|
|
while self._alive:
|
|
|
|
self._loop_once()
|
|
|
|
self._loop_once()
|
|
|
|