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)