mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
change a few uses of the threading APIs
This commit is contained in:
parent
cbae869759
commit
a9b2222de4
6 changed files with 16 additions and 16 deletions
|
@ -16,7 +16,7 @@ class DummyThreadingTestCase(unittest.TestCase):
|
|||
#delay = random.random() * 2
|
||||
delay = 0
|
||||
if test_support.verbose:
|
||||
print 'task', self.get_name(), 'will run for', delay, 'sec'
|
||||
print 'task', self.name, 'will run for', delay, 'sec'
|
||||
sema.acquire()
|
||||
mutex.acquire()
|
||||
running += 1
|
||||
|
@ -25,11 +25,11 @@ class DummyThreadingTestCase(unittest.TestCase):
|
|||
mutex.release()
|
||||
time.sleep(delay)
|
||||
if test_support.verbose:
|
||||
print 'task', self.get_name(), 'done'
|
||||
print 'task', self.name, 'done'
|
||||
mutex.acquire()
|
||||
running -= 1
|
||||
if test_support.verbose:
|
||||
print self.get_name(), 'is finished.', running, 'tasks are running'
|
||||
print self.name, 'is finished.', running, 'tasks are running'
|
||||
mutex.release()
|
||||
sema.release()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue