summaryrefslogtreecommitdiffstats
path: root/Demo
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-03-26 20:09:16 (GMT)
committerGuido van Rossum <guido@python.org>1998-03-26 20:09:16 (GMT)
commit07af9a7ddd815db303f67aeeca5c4d968aa120f4 (patch)
tree69cc6a330a3666fb2fcab90ca600a89b52c68610 /Demo
parent2830dcc15cd62de4c8004b2414ffde6ca9062b69 (diff)
downloadcpython-07af9a7ddd815db303f67aeeca5c4d968aa120f4.zip
cpython-07af9a7ddd815db303f67aeeca5c4d968aa120f4.tar.gz
cpython-07af9a7ddd815db303f67aeeca5c4d968aa120f4.tar.bz2
Add a sleep(0.00001) call to make sure all threads run.
Diffstat (limited to 'Demo')
-rw-r--r--Demo/threads/find.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Demo/threads/find.py b/Demo/threads/find.py
index d244bea..f858ccc 100644
--- a/Demo/threads/find.py
+++ b/Demo/threads/find.py
@@ -77,6 +77,7 @@ class WorkQ:
self.mutex.release()
def _worker(self):
+ time.sleep(0.00001) # Let other threads run
while 1:
job = self._getwork()
if not job:
@@ -97,6 +98,7 @@ class WorkQ:
# Main program
def main():
+ sys.argv.append("/tmp")
nworkers = 4
opts, args = getopt.getopt(sys.argv[1:], '-w:')
for opt, arg in opts: