aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-03-03 16:44:10 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-03-03 16:44:10 +0800
commit4e8aee0a768987f20277e6c3dabdfa6b52df75ef (patch)
tree54b2502e360cf2c47ee82c3a28088b77989a8e2b /camel
parent7dfbad5dce6da74e6c83b7b8196952f114e04a56 (diff)
downloadgsoc2013-evolution-4e8aee0a768987f20277e6c3dabdfa6b52df75ef.tar
gsoc2013-evolution-4e8aee0a768987f20277e6c3dabdfa6b52df75ef.tar.gz
gsoc2013-evolution-4e8aee0a768987f20277e6c3dabdfa6b52df75ef.tar.bz2
gsoc2013-evolution-4e8aee0a768987f20277e6c3dabdfa6b52df75ef.tar.lz
gsoc2013-evolution-4e8aee0a768987f20277e6c3dabdfa6b52df75ef.tar.xz
gsoc2013-evolution-4e8aee0a768987f20277e6c3dabdfa6b52df75ef.tar.zst
gsoc2013-evolution-4e8aee0a768987f20277e6c3dabdfa6b52df75ef.zip
attempt at uncancelling a cancelled operation.
2004-03-03 Not Zed <NotZed@Ximian.com> * camel-operation.c (camel_operation_uncancel): attempt at uncancelling a cancelled operation. svn path=/trunk/; revision=24947
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog3
-rw-r--r--camel/camel-operation.c24
-rw-r--r--camel/camel-operation.h1
3 files changed, 28 insertions, 0 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 273729d63e..db88be3994 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,8 @@
2004-03-03 Not Zed <NotZed@Ximian.com>
+ * camel-operation.c (camel_operation_uncancel): attempt at
+ uncancelling a cancelled operation.
+
* camel-stream-filter.c (do_write, do_write): fun dun diddley un
fun. Since we're writing a const buffer, we need to copy it
first. See #54937.
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
*
diff --git a/camel/camel-operation.h b/camel/camel-operation.h
index 62e29dc2ac..a190940175 100644
--- a/camel/camel-operation.h
+++ b/camel/camel-operation.h
@@ -46,6 +46,7 @@ void camel_operation_mute(CamelOperation *cc);
void camel_operation_ref(CamelOperation *cc);
void camel_operation_unref(CamelOperation *cc);
void camel_operation_cancel(CamelOperation *cc);
+void camel_operation_uncancel(CamelOperation *cc);
/* subthread functions */
CamelOperation *camel_operation_register(CamelOperation *cc);
void camel_operation_unregister (CamelOperation *cc);