Example #1
0
 def getMiniThread(self):
     callers_ts = threadstate.findThreadState()
     if callers_ts:
         self.lock.acquire()
         try:
             for mini in self.listofminithreads:
                 if mini.threadstate == callers_ts:
                     return mini
         finally:
             self.lock.release()
Example #2
0
 def getMiniThread(self):
     callers_ts = threadstate.findThreadState()
     if callers_ts:
         self.lock.acquire()
         try:
             for mini in self.listofminithreads:
                 if mini.threadstate == callers_ts:
                     return mini
         finally:
             self.lock.release()
Example #3
0
 def run(self):
     print os.getpid()
     ## startTime = time.time()
     try:
         try:
             self.threadstate = threadstate.findThreadState()
             self.function(*self.args, **self.kwargs)
             return
         except Exception, exception:
             print exception
             sys.stdout.flush()
     finally:
         self.threadstate.make_defunct()