Example #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)
    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)
Example #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)
 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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)