A few bugfixes to the storage barrier support.
authorMichael Vrable <mvrable@cs.ucsd.edu>
Wed, 2 Dec 2009 23:21:10 +0000 (15:21 -0800)
committerMichael Vrable <mvrable@cs.ucsd.edu>
Wed, 2 Dec 2009 23:21:10 +0000 (15:21 -0800)
bluesky/store.c

index cc8a5e4..03d4c4a 100644 (file)
@@ -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)