From a099afff8856bd80a1d974530c06fa78452e6c8c Mon Sep 17 00:00:00 2001 From: Michael Vrable Date: Thu, 15 Jul 2010 15:54:05 -0700 Subject: [PATCH] Barriers did not handle requests that finished too quickly. --- bluesky/store.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bluesky/store.c b/bluesky/store.c index 427112b..23e7047 100644 --- a/bluesky/store.c +++ b/bluesky/store.c @@ -292,13 +292,15 @@ void bluesky_store_add_barrier(BlueSkyStoreAsync *barrier, g_mutex_unlock(barrier->lock); g_mutex_lock(async->lock); - if (async->barrier == NULL) { + if (async->barrier == NULL && async->status != ASYNC_COMPLETE) { async->barrier = barrier; + g_mutex_unlock(async->lock); } else { - g_warning("Adding async to more than one barrier!\n"); + if (async->barrier != NULL) + g_warning("Adding async to more than one barrier!\n"); + g_mutex_unlock(async->lock); bluesky_store_async_add_notifier(async, op_complete, barrier); } - g_mutex_unlock(async->lock); } static void notifier_task(gpointer n, gpointer s) -- 2.20.1