Skip to content

Commit 5c67c41

Browse files
committed
Minor cosmetic changes
1 parent de33596 commit 5c67c41

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

pebble/pool/base_pool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def join(self, timeout: float = None):
7676
self.stop()
7777
self.join()
7878
else:
79-
self._context.task_queue.put(None)
79+
self._context.task_queue.put(None) # Pool termination sentinel
8080
self._stop_pool()
8181

8282
def _wait_queue_depletion(self, timeout: Optional[float]):

pebble/pool/channel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def __init__(self, mp_context: multiprocessing.context.BaseContext):
141141
def __getstate__(self):
142142
return self.reader_mutex, self.writer_mutex
143143

144-
def __setstate__(self, state):
144+
def __setstate__(self, state: tuple):
145145
self.reader_mutex, self.writer_mutex = state
146146
self.acquire = self._make_acquire_method()
147147
self.release = self._make_release_method()

pebble/pool/process.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def task_scheduler_loop(pool_manager: 'PoolManager'):
169169
else:
170170
pool_manager.schedule(task)
171171
else:
172-
task_queue.task_done()
172+
task_queue.task_done() # Termination sentinel received
173173
except BrokenProcessPool:
174174
context.status = PoolStatus.ERROR
175175

@@ -324,7 +324,7 @@ def timeout_tasks(self) -> tuple:
324324

325325
def cancelled_tasks(self) -> tuple:
326326
return tuple(t for t in dictionary_values(self.tasks)
327-
if t.timestamp != 0 and t.future.cancelled())
327+
if t.started and t.future.cancelled())
328328

329329
@staticmethod
330330
def timeout(task: Task) -> bool:

0 commit comments

Comments
 (0)