Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
empty list cannot be cleared issue fixed. (#14882)
Browse files Browse the repository at this point in the history
* empty list cannot be cleared issue fixed.

* Update multiproc_data.py

Co-authored-by: Sheng Zha <[email protected]>
  • Loading branch information
hsali and szha committed Sep 9, 2020
1 parent 5051fd9 commit a9bd1d2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions example/ctc/multiproc_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(self, num_processes, max_queue_size, fn):
self.queue = mp.Queue(maxsize=int(max_queue_size))
self.alive = mp.Value(c_bool, False, lock=False)
self.num_proc = num_processes
self.proc = list()
self.proc = []
self.fn = fn

def start(self):
Expand Down Expand Up @@ -122,4 +122,5 @@ def reset(self):
print("Queue size on reset: {}".format(qsize))
for i, p in enumerate(self.proc):
p.join()
self.proc.clear()
if self.proc:
self.proc = []

0 comments on commit a9bd1d2

Please sign in to comment.