gthreadedresolver: Remove some incorrect assertions

If a timeout executes on the same main context iteration as completion
or cancellation of a resolver lookup, `has_returned` will be set
multiple times. That’s fine (the `GCond` will be notified multiple
times, but that’s fine). It was triggering an incorrect assertion, so
remove that.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
Philip Withnall 2023-04-27 14:41:26 +01:00
parent 7922d3200c
commit 865cbe3714

View File

@ -1439,7 +1439,6 @@ timeout_cb (gpointer user_data)
/* Signal completion of the task. */
g_mutex_lock (&data->lock);
g_assert (!data->has_returned);
data->has_returned = TRUE;
g_cond_broadcast (&data->cond);
g_mutex_unlock (&data->lock);
@ -1470,7 +1469,6 @@ cancelled_cb (GCancellable *cancellable,
/* Signal completion of the task. */
g_mutex_lock (&data->lock);
g_assert (!data->has_returned);
data->has_returned = TRUE;
g_cond_broadcast (&data->cond);
g_mutex_unlock (&data->lock);
@ -1605,7 +1603,6 @@ threaded_resolver_worker_cb (gpointer task_data,
/* Signal completion of a task. */
g_mutex_lock (&data->lock);
g_assert (!data->has_returned);
data->has_returned = TRUE;
g_cond_broadcast (&data->cond);
g_mutex_unlock (&data->lock);