def start(self):
     """Start the thread."""
     self.quit = False
     self.has_quit = False
     self._tident = _nogevent.start_new_thread(self.run, tuple())
     if _nogevent.threading_get_native_id:
         self._native_id = _nogevent.threading_get_native_id()
Example #2
0
 def start(self):
     """Start the thread."""
     self.quit = False
     self.has_quit = False
     threading._limbo[self] = self
     try:
         self._tident = _nogevent.start_new_thread(self.run, tuple())
     except Exception:
         del threading._limbo[self]
     if _nogevent.threading_get_native_id:
         self._native_id = _nogevent.threading_get_native_id()
Example #3
0
    def start(self):
        """Start the thread."""
        self.quit = False
        if self._tident is not None:
            raise RuntimeError("threads can only be started once")
        self._tident = _nogevent.start_new_thread(self.run, tuple())
        if _nogevent.threading_get_native_id:
            self._native_id = _nogevent.threading_get_native_id()

        # Wait for the thread to be started to avoid race conditions
        while not self._periodic_started:
            time.sleep(self.SLEEP_INTERVAL)