Commit 33678cf7 authored by Julien Jerphanion's avatar Julien Jerphanion

Lock worker when adding tasks to the queue

This sole hunk has been extracted from:
https://github.com/abilian/cythonplus-sandbox/commit/a3743de8437e482720c1f441d5a019f18a390df1.patchCo-authored-by: default avatarJerome Dumonteil <jd@abilian.com>
Co-authored-by: Xavier Thompson's avatarXavier Thompson <xavier.thompson@nexedi.com>
parent 1d5b80e4
......@@ -44,7 +44,8 @@ cdef inline void * worker_function(void * arg) nogil:
# Discard the empty queue and continue the main loop.
continue
# The queue is not empty: reinsert it in this worker's queues.
worker.queues.push_back(queue)
with wlocked worker:
worker.queues.push_back(queue)
# Signal that the queue is available.
sem_post(&sch.num_free_queues)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment