Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 17 lines (13 sloc) 248 Bytes
#!/usr/bin/python
from multiprocessing import Semaphore
sem = Semaphore()
i = 0
while True:
i += 1
if i % 10000 == 0:
print sem.get_value()
try:
sem.release()
except:
print `sem.get_value()`
raise