/**
* camel_store_lock:
* @store: a #CamelStore
- * @lock: lock type to lock
*
- * Locks @store's @lock. Unlock it with camel_store_unlock().
+ * Locks @store. Unlock it with camel_store_unlock().
*
* Since: 2.32
**/
void
-camel_store_lock (CamelStore *store,
- CamelStoreLock lock)
+camel_store_lock (CamelStore *store)
{
g_return_if_fail (CAMEL_IS_STORE (store));
- switch (lock) {
- case CAMEL_STORE_FOLDER_LOCK:
- g_rec_mutex_lock (&store->priv->folder_lock);
- break;
- default:
- g_return_if_reached ();
- }
+ g_rec_mutex_lock (&store->priv->folder_lock);
}
/**
* camel_store_unlock:
* @store: a #CamelStore
- * @lock: lock type to unlock
*
- * Unlocks @store's @lock, previously locked with camel_store_lock().
+ * Unlocks @store, previously locked with camel_store_lock().
*
* Since: 2.32
**/
void
-camel_store_unlock (CamelStore *store,
- CamelStoreLock lock)
+camel_store_unlock (CamelStore *store)
{
g_return_if_fail (CAMEL_IS_STORE (store));
- switch (lock) {
- case CAMEL_STORE_FOLDER_LOCK:
- g_rec_mutex_unlock (&store->priv->folder_lock);
- break;
- default:
- g_return_if_reached ();
- }
+ g_rec_mutex_unlock (&store->priv->folder_lock);
}
/**
class = CAMEL_STORE_GET_CLASS (store);
g_return_val_if_fail (class->get_inbox_folder_sync != NULL, NULL);
- camel_store_lock (store, CAMEL_STORE_FOLDER_LOCK);
+ camel_store_lock (store);
/* Check for cancellation after locking. */
if (g_cancellable_set_error_if_cancelled (cancellable, error)) {
- camel_store_unlock (store, CAMEL_STORE_FOLDER_LOCK);
+ camel_store_unlock (store);
return NULL;
}
CAMEL_CHECK_GERROR (
store, get_inbox_folder_sync, folder != NULL, error);
- camel_store_unlock (store, CAMEL_STORE_FOLDER_LOCK);
+ camel_store_unlock (store);
return folder;
}
return NULL;
}
- camel_store_lock (store, CAMEL_STORE_FOLDER_LOCK);
+ camel_store_lock (store);
/* Check for cancellation after locking. */
if (g_cancellable_set_error_if_cancelled (cancellable, error)) {
- camel_store_unlock (store, CAMEL_STORE_FOLDER_LOCK);
+ camel_store_unlock (store);
return NULL;
}
camel_operation_pop_message (cancellable);
- camel_store_unlock (store, CAMEL_STORE_FOLDER_LOCK);
+ camel_store_unlock (store);
return fi;
}
return FALSE;
}
- camel_store_lock (store, CAMEL_STORE_FOLDER_LOCK);
+ camel_store_lock (store);
/* Check for cancellation after locking. */
if (g_cancellable_set_error_if_cancelled (cancellable, error)) {
- camel_store_unlock (store, CAMEL_STORE_FOLDER_LOCK);
+ camel_store_unlock (store);
return FALSE;
}
else
g_propagate_error (error, local_error);
- camel_store_unlock (store, CAMEL_STORE_FOLDER_LOCK);
+ camel_store_unlock (store);
return success;
}
old_name = g_strdup (old_namein);
oldlen = strlen (old_name);
- camel_store_lock (store, CAMEL_STORE_FOLDER_LOCK);
+ camel_store_lock (store);
/* Check for cancellation after locking. */
if (g_cancellable_set_error_if_cancelled (cancellable, error)) {
- camel_store_unlock (store, CAMEL_STORE_FOLDER_LOCK);
+ camel_store_unlock (store);
return FALSE;
}
}
}
- camel_store_unlock (store, CAMEL_STORE_FOLDER_LOCK);
+ camel_store_unlock (store);
g_ptr_array_free (folders, TRUE);
g_free (old_name);
interface = CAMEL_SUBSCRIBABLE_GET_INTERFACE (subscribable);
g_return_val_if_fail (interface->folder_is_subscribed != NULL, FALSE);
- camel_store_lock (
- CAMEL_STORE (subscribable),
- CAMEL_STORE_FOLDER_LOCK);
+ camel_store_lock (CAMEL_STORE (subscribable));
is_subscribed = interface->folder_is_subscribed (
subscribable, folder_name);
- camel_store_unlock (
- CAMEL_STORE (subscribable),
- CAMEL_STORE_FOLDER_LOCK);
+ camel_store_unlock (CAMEL_STORE (subscribable));
return is_subscribed;
}
interface = CAMEL_SUBSCRIBABLE_GET_INTERFACE (subscribable);
g_return_val_if_fail (interface->subscribe_folder_sync != NULL, FALSE);
- camel_store_lock (
- CAMEL_STORE (subscribable),
- CAMEL_STORE_FOLDER_LOCK);
+ camel_store_lock (CAMEL_STORE (subscribable));
/* Check for cancellation after locking. */
if (g_cancellable_set_error_if_cancelled (cancellable, error)) {
camel_operation_pop_message (cancellable);
exit:
- camel_store_unlock (
- CAMEL_STORE (subscribable),
- CAMEL_STORE_FOLDER_LOCK);
+ camel_store_unlock (CAMEL_STORE (subscribable));
return success;
}
g_return_val_if_fail (
interface->unsubscribe_folder_sync != NULL, FALSE);
- camel_store_lock (
- CAMEL_STORE (subscribable),
- CAMEL_STORE_FOLDER_LOCK);
+ camel_store_lock (CAMEL_STORE (subscribable));
/* Check for cancellation after locking. */
if (g_cancellable_set_error_if_cancelled (cancellable, error)) {
camel_operation_pop_message (cancellable);
exit:
- camel_store_unlock (
- CAMEL_STORE (subscribable),
- CAMEL_STORE_FOLDER_LOCK);
+ camel_store_unlock (CAMEL_STORE (subscribable));
return success;
}