aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-operation.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2001-07-24 08:56:11 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-07-24 08:56:11 +0800
commit5ef14553c1129aaaf1691c14219a5bcce29bf64f (patch)
tree89b82e1b53740fdc7cf8ba87aa51133c35317748 /camel/camel-operation.c
parent2807ad0103bf4f320019ac83d9af5013e6b40913 (diff)
downloadgsoc2013-evolution-5ef14553c1129aaaf1691c14219a5bcce29bf64f.tar
gsoc2013-evolution-5ef14553c1129aaaf1691c14219a5bcce29bf64f.tar.gz
gsoc2013-evolution-5ef14553c1129aaaf1691c14219a5bcce29bf64f.tar.bz2
gsoc2013-evolution-5ef14553c1129aaaf1691c14219a5bcce29bf64f.tar.lz
gsoc2013-evolution-5ef14553c1129aaaf1691c14219a5bcce29bf64f.tar.xz
gsoc2013-evolution-5ef14553c1129aaaf1691c14219a5bcce29bf64f.tar.zst
gsoc2013-evolution-5ef14553c1129aaaf1691c14219a5bcce29bf64f.zip
Added some warnings for bad cases.
2001-07-24 Not Zed <NotZed@Ximian.com> * camel-operation.c (camel_operation_register, unregister): Added some warnings for bad cases. 2001-07-23 Not Zed <NotZed@Ximian.com> * camel-operation.c (camel_operation_register): Only insert a hash entry if we haven't already. (camel_operation_unregister): Only remove the has entry if the id is a real thread. svn path=/trunk/; revision=11329
Diffstat (limited to 'camel/camel-operation.c')
-rw-r--r--camel/camel-operation.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/camel/camel-operation.c b/camel/camel-operation.c
index 0b5678d29a..dce3340b9a 100644
--- a/camel/camel-operation.c
+++ b/camel/camel-operation.c
@@ -291,8 +291,12 @@ void camel_operation_register(CamelOperation *cc)
}
}
- cc->id = id;
- g_hash_table_insert(operation_active, (void *)id, cc);
+ if (cc->id == (~0)) {
+ cc->id = id;
+ g_hash_table_insert(operation_active, (void *)id, cc);
+ } else {
+ g_warning("Re-registering thread %d for cancellation as thread %d", cc->id, id);
+ }
d(printf("registering thread %ld for cancellation\n", id));
@@ -322,8 +326,14 @@ void camel_operation_unregister(CamelOperation *cc)
}
}
- if (cc)
- g_hash_table_remove(operation_active, (void *)cc->id);
+ if (cc) {
+ if (cc->id != (~0)) {
+ g_hash_table_remove(operation_active, (void *)cc->id);
+ cc->id == ~0;
+ } else {
+ g_warning("Unregistering an operation that was already unregistered");
+ }
+ }
CAMEL_ACTIVE_UNLOCK();