summaryrefslogtreecommitdiff
path: root/glib/gasyncqueue.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2006-03-20 18:43:32 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2006-03-20 18:43:32 +0000
commitd0ee63840cd8c7760614810822370aee0382683f (patch)
tree8a7c82bc92018d07ce4cd03351c23dca05a25df5 /glib/gasyncqueue.c
parent56b06e14dcfac3e22837aa9db0a2c102e6c580cd (diff)
downloadglib-d0ee63840cd8c7760614810822370aee0382683f.tar.gz
use standard_calloc to allocate the profile_data. (#335209, Chris Wilson)
2006-03-20 Matthias Clasen <mclasen@redhat.com> * glib/gmem.c (profiler_log): use standard_calloc to allocate the profile_data. (#335209, Chris Wilson) * glib/gmain.c (g_main_context_unref): Avoid a deadlock. (#335207, Chris Wilson) Minor optimizations (#335216, Chris Wilson): * glib/gasyncqueue.c (g_async_queue_pop_intern_unlocked): Use g_queue_peek_tail_link instead of g_queue_peek_tail. * glib/glist.c: * glib/gslist.c: Avoid some memset calls.
Diffstat (limited to 'glib/gasyncqueue.c')
-rw-r--r--glib/gasyncqueue.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/glib/gasyncqueue.c b/glib/gasyncqueue.c
index e025b50c4..8d6f3f295 100644
--- a/glib/gasyncqueue.c
+++ b/glib/gasyncqueue.c
@@ -313,12 +313,13 @@ g_async_queue_push_sorted_unlocked (GAsyncQueue *queue,
}
static gpointer
-g_async_queue_pop_intern_unlocked (GAsyncQueue* queue, gboolean try,
- GTimeVal *end_time)
+g_async_queue_pop_intern_unlocked (GAsyncQueue *queue,
+ gboolean try,
+ GTimeVal *end_time)
{
gpointer retval;
- if (!g_queue_peek_tail (queue->queue))
+ if (!g_queue_peek_tail_link (queue->queue))
{
if (try)
return NULL;
@@ -329,18 +330,18 @@ g_async_queue_pop_intern_unlocked (GAsyncQueue* queue, gboolean try,
if (!end_time)
{
queue->waiting_threads++;
- while (!g_queue_peek_tail (queue->queue))
- g_cond_wait(queue->cond, queue->mutex);
+ while (!g_queue_peek_tail_link (queue->queue))
+ g_cond_wait (queue->cond, queue->mutex);
queue->waiting_threads--;
}
else
{
queue->waiting_threads++;
- while (!g_queue_peek_tail (queue->queue))
+ while (!g_queue_peek_tail_link (queue->queue))
if (!g_cond_timed_wait (queue->cond, queue->mutex, end_time))
break;
queue->waiting_threads--;
- if (!g_queue_peek_tail (queue->queue))
+ if (!g_queue_peek_tail_link (queue->queue))
return NULL;
}
}