]> granicus.if.org Git - python/commitdiff
Add a sleep(0.00001) call to make sure all threads run.
authorGuido van Rossum <guido@python.org>
Thu, 26 Mar 1998 20:09:16 +0000 (20:09 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 26 Mar 1998 20:09:16 +0000 (20:09 +0000)
Demo/threads/find.py

index d244beaf25a49434f526f585b1d305e704097385..f858ccceb86a509b28d3192c050db94c60c28be8 100644 (file)
@@ -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: