Пример #1
0
def runThread(func):
    #lock.acquire()
    print(stackless.getruncount(), stackless.getthreads())
    numCurrentThreads = stackless.getthreads()
    latestThread = numCurrentThreads[-1]
    numCurrentThreads = len(numCurrentThreads)
    subthreads = list()
    for i in range(numCurrentThreads):
        subthreads.append(Thread(target=checkedRun, args=(func, )))
        subthreads[-1].start()
    print(stackless.getruncount(), stackless.getthreads())
    print(stackless.main)
    time.sleep(2)
Пример #2
0
 def test_get_threads(self):
     self.assertEqual(type(stackless.getthreads()), list)
Пример #3
0
def run2():
    stackless.tasklet(first2)()
    stackless.tasklet(second2)()
    #import pdb; pdb.set_trace()
    print(stackless.getruncount(), stackless.getthreads())
    stackless.run()
Пример #4
0
 def test_get_threads(self):
     self.assertEqual(type(stackless.getthreads()), list)