aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-operation.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-operation.c')
-rw-r--r--camel/camel-operation.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/camel/camel-operation.c b/camel/camel-operation.c
index 5e041a18cf..8718c52e99 100644
--- a/camel/camel-operation.c
+++ b/camel/camel-operation.c
@@ -306,6 +306,30 @@ camel_operation_cancel (CamelOperation *cc)
}
/**
+ * camel_operation_uncancel:
+ * @cc: operation context
+ *
+ * Uncancel a cancelled operation. If @cc is NULL then the current
+ * operation is uncancelled.
+ *
+ * This is useful, if e.g. you need to do some cleaning up where a
+ * cancellation lying around in the same thread will abort any
+ * processing.
+ **/
+void
+camel_operation_uncancel(CamelOperation *cc)
+{
+ if (cc == NULL)
+ cc = (CamelOperation *)pthread_getspecific(operation_key);
+
+ if (cc) {
+ LOCK();
+ cc->flags &= ~CAMEL_OPERATION_CANCELLED;
+ UNLOCK();
+ }
+}
+
+/**
* camel_operation_register:
* @cc: operation context
*