예제 #1
0
 def __init__(self, space):
     "NOT_RPYTHON"
     AsyncAction.__init__(self, space)
     self.pending_signal = -1
     self.fire_in_another_thread = False
     if self.space.config.objspace.usemodules.thread:
         from pypy.module.thread import gil
         gil.after_thread_switch = self._after_thread_switch
예제 #2
0
 def __init__(self, space):
     "NOT_RPYTHON"
     AsyncAction.__init__(self, space)
     self.pending_signal = -1
     self.fire_in_another_thread = False
     if self.space.config.objspace.usemodules.thread:
         from pypy.module.thread import gil
         gil.after_thread_switch = self._after_thread_switch
예제 #3
0
 def __init__(self, space):
     AsyncAction.__init__(self, space)
     self.handlers_w = {}
     if space.config.objspace.usemodules.thread:
         # need a helper action in case signals arrive in a non-main thread
         self.pending_signals = {}
         self.reissue_signal_action = ReissueSignalAction(space)
     else:
         self.reissue_signal_action = None
예제 #4
0
 def __init__(self, space):
     AsyncAction.__init__(self, space)
     self.handlers_w = {}
     if space.config.objspace.usemodules.thread:
         # need a helper action in case signals arrive in a non-main thread
         self.pending_signals = {}
         self.reissue_signal_action = ReissueSignalAction(space)
     else:
         self.reissue_signal_action = None
예제 #5
0
    def __init__(self, space):
        "NOT_RPYTHON"
        AsyncAction.__init__(self, space)
        self.pending_signal = -1
        self.fire_in_another_thread = False

        @rgc.no_collect
        def _after_thread_switch():
            if self.fire_in_another_thread:
                if self.space.threadlocals.signals_enabled():
                    self.fire_in_another_thread = False
                    self.space.actionflag.rearm_ticker()
                    # this occurs when we just switched to the main thread
                    # and there is a signal pending: we force the ticker to
                    # -1, which should ensure perform() is called quickly.
        self._after_thread_switch = _after_thread_switch
예제 #6
0
    def __init__(self, space):
        "NOT_RPYTHON"
        AsyncAction.__init__(self, space)
        self.pending_signal = -1
        self.fire_in_another_thread = False
        #
        @rgc.no_collect
        def _after_thread_switch():
            if self.fire_in_another_thread:
                if self.space.threadlocals.signals_enabled():
                    self.fire_in_another_thread = False
                    self.space.actionflag.rearm_ticker()
                    # this occurs when we just switched to the main thread
                    # and there is a signal pending: we force the ticker to
                    # -1, which should ensure perform() is called quickly.

        self._after_thread_switch = _after_thread_switch
예제 #7
0
파일: hook.py 프로젝트: sota/pypy
 def __init__(self, space):
     AsyncAction.__init__(self, space)
     self.w_callable = space.w_None
     self.reset()