From: Michael Vrable Date: Wed, 2 Dec 2009 23:21:10 +0000 (-0800) Subject: A few bugfixes to the storage barrier support. X-Git-Url: https://git.vrable.net/?a=commitdiff_plain;h=a8339d9810e470f59dffb3e186dd693b751ae04a;p=bluesky.git A few bugfixes to the storage barrier support. --- diff --git a/bluesky/store.c b/bluesky/store.c index cc8a5e4..03d4c4a 100644 --- a/bluesky/store.c +++ b/bluesky/store.c @@ -110,6 +110,8 @@ void bluesky_store_async_unref(BlueSkyStoreAsync *async) g_free(async->key); bluesky_string_unref(async->data); g_free(async); + g_log("bluesky/store", G_LOG_LEVEL_DEBUG, + "freeing async"); g_print("Freed async\n"); } } @@ -184,13 +186,19 @@ void bluesky_store_async_submit(BlueSkyStoreAsync *async) /* Barriers are handled specially, and not handed down the storage * implementation layer. */ - if (async->op = STORE_OP_BARRIER) { + if (async->op == STORE_OP_BARRIER) { async->status = ASYNC_RUNNING; if (GPOINTER_TO_INT(async->store_private) == 0) bluesky_store_async_mark_complete(async); return; } + g_log("bluesky/store", G_LOG_LEVEL_DEBUG, "submit: %s %s", + async->op == STORE_OP_GET ? "GET" + : async->op == STORE_OP_PUT ? "PUT" + : async->op == STORE_OP_DELETE ? "DELETE" : "???", + async->key); + g_mutex_lock(async->store->lock); async->store->pending++; g_mutex_unlock(async->store->lock); @@ -225,7 +233,7 @@ void bluesky_store_add_barrier(BlueSkyStoreAsync *barrier, g_return_if_fail(barrier->op == STORE_OP_BARRIER); barrier->store_private = GINT_TO_POINTER(GPOINTER_TO_INT(barrier->store_private) + 1); - bluesky_store_async_add_notifier(async, op_complete, NULL); + bluesky_store_async_add_notifier(async, op_complete, barrier); } static void notifier_task(gpointer n, gpointer s)