You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migrate work for finished CurrentThreadExecutor to previous executor
A CurrentThreadExecutor may terminate with work still remaining in its
queue, or new work may be submitted later. We previously discarded
remaining work, leading to deadlocks, and raised an error on
submitting late work. But if there’s another CurrentThreadExecutor
for the same thread below us on the stack, we should instead migrate
the extra work there to allow it to eventually run.
Doing this in a thread-safe way requires replacing the queue.Queue
abstraction with collections.deque and
threading.ConditionVariable (the same primitives used to implement
queue.Queue).
Fixes#491; fixes#492.
Signed-off-by: Anders Kaseorg <[email protected]>
0 commit comments