Part two of the previous commit >_<
This commit is contained in:
@@ -4,17 +4,17 @@ import traceback
|
|||||||
import warnings
|
import warnings
|
||||||
import signal
|
import signal
|
||||||
|
|
||||||
|
HAS_ITIMER = False
|
||||||
alarm_func = signal.alarm
|
alarm_func = signal.alarm
|
||||||
|
if hasattr(signal, 'setitimer'):
|
||||||
try:
|
HAS_ITIMER = True
|
||||||
if hasattr(signal, 'setitimer'):
|
else:
|
||||||
HAS_ITIMER = True
|
try:
|
||||||
else:
|
|
||||||
import itimer
|
import itimer
|
||||||
HAS_ITIMER = True
|
HAS_ITIMER = True
|
||||||
alarm_func = itimer.alarm
|
alarm_func = itimer.alarm
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
from eventlet.support import greenlets as greenlet, clear_sys_exc_info
|
from eventlet.support import greenlets as greenlet, clear_sys_exc_info
|
||||||
from eventlet.hubs import timer
|
from eventlet.hubs import timer
|
||||||
@@ -92,9 +92,7 @@ class BaseHub(object):
|
|||||||
self._old_signal_handler = tmp
|
self._old_signal_handler = tmp
|
||||||
|
|
||||||
if HAS_ITIMER:
|
if HAS_ITIMER:
|
||||||
itimer.alarm(self.debug_blocking_resolution)
|
alarm_func(self.debug_blocking_resolution)
|
||||||
else:
|
|
||||||
signal.alarm(self.debug_blocking_resolution)
|
|
||||||
|
|
||||||
def block_detect_post(self):
|
def block_detect_post(self):
|
||||||
if (hasattr(self, "_old_signal_handler") and
|
if (hasattr(self, "_old_signal_handler") and
|
||||||
|
Reference in New Issue
Block a user