Add a sleep(0.00001) call to make sure all threads run.
This commit is contained in:
parent
2830dcc15c
commit
07af9a7ddd
|
@ -77,6 +77,7 @@ class WorkQ:
|
||||||
self.mutex.release()
|
self.mutex.release()
|
||||||
|
|
||||||
def _worker(self):
|
def _worker(self):
|
||||||
|
time.sleep(0.00001) # Let other threads run
|
||||||
while 1:
|
while 1:
|
||||||
job = self._getwork()
|
job = self._getwork()
|
||||||
if not job:
|
if not job:
|
||||||
|
@ -97,6 +98,7 @@ class WorkQ:
|
||||||
# Main program
|
# Main program
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
sys.argv.append("/tmp")
|
||||||
nworkers = 4
|
nworkers = 4
|
||||||
opts, args = getopt.getopt(sys.argv[1:], '-w:')
|
opts, args = getopt.getopt(sys.argv[1:], '-w:')
|
||||||
for opt, arg in opts:
|
for opt, arg in opts:
|
||||||
|
|
Loading…
Reference in New Issue