Esempio n. 1
0
 def acquire_thread(self):
     """Run 'start_thread' listeners for the current thread.
     
     If the current thread has already been seen, any 'start_thread'
     listeners will not be run again.
     """
     thread_ident = get_thread_ident()
     if thread_ident not in self.threads:
         i = len(self.threads) + 1
         self.threads[thread_ident] = i
         self.bus.publish('start_thread', i)
Esempio n. 2
0
    def acquire_thread(self):
        """Run 'start_thread' listeners for the current thread.

        If the current thread has already been seen, any 'start_thread'
        listeners will not be run again.
        """
        thread_ident = get_thread_ident()
        if thread_ident not in self.threads:
            # We can't just use get_ident as the thread ID
            # because some platforms reuse thread ID's.
            i = len(self.threads) + 1
            self.threads[thread_ident] = i
            self.bus.publish('start_thread', i)
Esempio n. 3
0
    def acquire_thread(self):
        """Run 'start_thread' listeners for the current thread.

        If the current thread has already been seen, any 'start_thread'
        listeners will not be run again.
        """
        thread_ident = get_thread_ident()
        if thread_ident not in self.threads:
            # We can't just use get_ident as the thread ID
            # because some platforms reuse thread ID's.
            i = len(self.threads) + 1
            self.threads[thread_ident] = i
            self.bus.publish('start_thread', i)
Esempio n. 4
0
 def release_thread(self):
     """Release the current thread and run 'stop_thread' listeners."""
     thread_ident = get_thread_ident()
     i = self.threads.pop(thread_ident, None)
     if i is not None:
         self.bus.publish('stop_thread', i)
Esempio n. 5
0
 def release_thread(self):
     """Release the current thread and run 'stop_thread' listeners."""
     thread_ident = get_thread_ident()
     i = self.threads.pop(thread_ident, None)
     if i is not None:
         self.bus.publish('stop_thread', i)
Esempio n. 6
0
 def release_thread(self):
     thread_ident = get_thread_ident()
     i = self.threads.pop(thread_ident, None)
     if i is not None:
         self.bus.publish('stop_thread', i)
Esempio n. 7
0
 def acquire_thread(self):
     thread_ident = get_thread_ident()
     if thread_ident not in self.threads:
         i = len(self.threads) + 1
         self.threads[thread_ident] = i
         self.bus.publish('start_thread', i)
Esempio n. 8
0
 def release_thread(self):
     thread_ident = get_thread_ident()
     i = self.threads.pop(thread_ident, None)
     if i is not None:
         self.bus.publish('stop_thread', i)
Esempio n. 9
0
 def acquire_thread(self):
     thread_ident = get_thread_ident()
     if thread_ident not in self.threads:
         i = len(self.threads) + 1
         self.threads[thread_ident] = i
         self.bus.publish('start_thread', i)