... as g_cancellable_cancel()
Rework a g_critical() that would (rarely) trigger when _reset() was
called in a thread different from _cancel() by making _reset() wait for
the cancel function to be finished the same way
g_cancellable_disconnect() uses.
G_LOCK(cancellable);
- if (cancellable->cancelled_running)
+ while (cancellable->cancelled_running)
{
- g_critical ("Can't reset a cancellable during an active operation");
- G_UNLOCK(cancellable);
- return;
+ cancellable->cancelled_running_waiting = TRUE;
+ g_cond_wait (cancellable_cond,
+ g_static_mutex_get_mutex (& G_LOCK_NAME (cancellable)));
}
if (cancellable->cancelled)