diff options
author | Philip Withnall <philip@tecnocode.co.uk> | 2018-07-29 16:12:51 +0200 |
---|---|---|
committer | Philip Withnall <withnall@endlessm.com> | 2018-07-30 17:18:03 +0100 |
commit | ef1d24974d91c3724f62bdf62d734914c82e4041 (patch) | |
tree | 4c7e58f05a8df871651d45e8b1a33b6b5cc3e5de /glib/gasyncqueue.c | |
parent | 2d7423b98600fea11f7fefae3b641d34ea5cc02a (diff) | |
download | glib-ef1d24974d91c3724f62bdf62d734914c82e4041.tar.gz |
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
Diffstat (limited to 'glib/gasyncqueue.c')
-rw-r--r-- | glib/gasyncqueue.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/glib/gasyncqueue.c b/glib/gasyncqueue.c index 8529beb8b..3eb38393d 100644 --- a/glib/gasyncqueue.c +++ b/glib/gasyncqueue.c @@ -539,6 +539,8 @@ g_async_queue_timeout_pop (GAsyncQueue *queue, gint64 end_time = g_get_monotonic_time () + timeout; gpointer retval; + g_return_val_if_fail (queue != NULL, NULL); + g_mutex_lock (&queue->mutex); retval = g_async_queue_pop_intern_unlocked (queue, TRUE, end_time); 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; + g_return_val_if_fail (queue != NULL, NULL); + return g_async_queue_pop_intern_unlocked (queue, TRUE, end_time); } |