gasyncqueue: Add missing precondition to g_async_queue_timeout_pop()

And g_async_queue_timeout_pop_unlocked().

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>

https://gitlab.gnome.org/GNOME/glib/issues/1459
This commit is contained in:
Philip Withnall 2018-07-29 16:12:51 +02:00 committed by Philip Withnall
parent 2d7423b986
commit ef1d24974d

View File

@ -539,6 +539,8 @@ g_async_queue_timeout_pop (GAsyncQueue *queue,
gint64 end_time = g_get_monotonic_time () + timeout; gint64 end_time = g_get_monotonic_time () + timeout;
gpointer retval; gpointer retval;
g_return_val_if_fail (queue != NULL, NULL);
g_mutex_lock (&queue->mutex); g_mutex_lock (&queue->mutex);
retval = g_async_queue_pop_intern_unlocked (queue, TRUE, end_time); retval = g_async_queue_pop_intern_unlocked (queue, TRUE, end_time);
g_mutex_unlock (&queue->mutex); g_mutex_unlock (&queue->mutex);
@ -567,6 +569,8 @@ g_async_queue_timeout_pop_unlocked (GAsyncQueue *queue,
{ {
gint64 end_time = g_get_monotonic_time () + timeout; gint64 end_time = g_get_monotonic_time () + timeout;
g_return_val_if_fail (queue != NULL, NULL);
return g_async_queue_pop_intern_unlocked (queue, TRUE, end_time); return g_async_queue_pop_intern_unlocked (queue, TRUE, end_time);
} }