Skip to content
Snippets Groups Projects
Commit 01c0cec0 authored by Yohann Bearzi (Kitware)'s avatar Yohann Bearzi (Kitware)
Browse files

Fixing vtkThreadedCallbackQueue deadlock

When one is calling `Wait()` on a future, the future will try to un its
priors if they are enqueued (not on hold) using a constant-time lookup
through the `InvokerIndex` member. There was a race condition with the
regular path for running tasks. The queue could try to run the prior
while the user does it as well. When this happens, the computed index in
the queue is negative (because the prior has been popped in the regular
pathe). When such occurenc happens, we abandon trying to run the prior.

Setting the invoker's status to `RUNNING` was done in `Invoke()`. It
turns out that there are cases when we want to set it befor calling
`Invoke()`. From now on, each part of the code about to invoke is
responsible for updating its status.
parent 29f73914
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment