aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/notmuch.h
diff options
context:
space:
mode:
authorGravatar Austin Clements <amdragon@mit.edu>2011-06-10 23:35:06 -0400
committerGravatar David Bremner <bremner@debian.org>2011-09-23 21:50:38 -0400
commite59cc0031fbf84f49e32dedb9927f427d2c49309 (patch)
treea62b654a3a0bc1bdb1b394dd3e6dc9a2dd046931 /lib/notmuch.h
parent957f1ba3fc1d737887029ff1787fc6bea94de00b (diff)
lib: Add support for nested atomic sections.
notmuch_database_t now keeps a nesting count and we only start a transaction or commit for the outermost atomic section. Introduces a new error, NOTMUCH_STATUS_UNBALANCED_ATOMIC.
Diffstat (limited to 'lib/notmuch.h')
-rw-r--r--lib/notmuch.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/notmuch.h b/lib/notmuch.h
index 0c306bb5..bfa2ced8 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -81,6 +81,9 @@ typedef int notmuch_bool_t;
* NOTMUCH_STATUS_UNBALANCED_FREEZE_THAW: The notmuch_message_thaw
* function has been called more times than notmuch_message_freeze.
*
+ * NOTMUCH_STATUS_UNBALANCED_ATOMIC: notmuch_database_end_atomic has
+ * been called more times than notmuch_database_begin_atomic.
+ *
* And finally:
*
* NOTMUCH_STATUS_LAST_STATUS: Not an actual status value. Just a way
@@ -97,6 +100,7 @@ typedef enum _notmuch_status {
NOTMUCH_STATUS_NULL_POINTER,
NOTMUCH_STATUS_TAG_TOO_LONG,
NOTMUCH_STATUS_UNBALANCED_FREEZE_THAW,
+ NOTMUCH_STATUS_UNBALANCED_ATOMIC,
NOTMUCH_STATUS_LAST_STATUS
} notmuch_status_t;
@@ -222,6 +226,9 @@ notmuch_database_upgrade (notmuch_database_t *database,
* only ensures atomicity, not durability; neither begin nor end
* necessarily flush modifications to disk.
*
+ * Atomic sections may be nested. begin_atomic and end_atomic must
+ * always be called in pairs.
+ *
* Return value:
*
* NOTMUCH_STATUS_SUCCESS: Successfully entered atomic section.
@@ -240,6 +247,9 @@ notmuch_database_begin_atomic (notmuch_database_t *notmuch);
*
* NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred;
* atomic section not ended.
+ *
+ * NOTMUCH_STATUS_UNBALANCED_ATOMIC: The database is not currently in
+ * an atomic section.
*/
notmuch_status_t
notmuch_database_end_atomic (notmuch_database_t *notmuch);