aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-mt.c
diff options
context:
space:
mode:
author6 <NotZed@Ximian.com>2001-10-17 01:34:59 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-10-17 01:34:59 +0800
commit41802db26312f2d70ff5624e331e45277ce8a8ec (patch)
tree1ba4c61fa37c6e10942af3b24d9e24cbc85f33f6 /mail/mail-mt.c
parent1ca6ce72ac9952f1429873b3c129cdd643ee4462 (diff)
downloadgsoc2013-evolution-41802db26312f2d70ff5624e331e45277ce8a8ec.tar.gz
gsoc2013-evolution-41802db26312f2d70ff5624e331e45277ce8a8ec.tar.zst
gsoc2013-evolution-41802db26312f2d70ff5624e331e45277ce8a8ec.zip
New function to return the id of the currently executing proxied event.
2001-10-16 <NotZed@Ximian.com> * mail-mt.c (mail_proxy_event_id): New function to return the id of the currently executing proxied event. * folder-browser.h: Added private field. * folder-browser.c (folder_changed): Keep track of tasks outstanding in the tasks list, locked access. (FOLDER_BROWSER_LOCK, UNLOCK): Macros to lock the folder browser for poking about in diff threads. (folder_browser_finalise): Wait for any outstanding takss to finish before cleaning ourself up. (folder_browser_destroy): Move the seen_id handling to finalise, also add a loading_id handling code. (main_folder_changed): Remove our running task when done. svn path=/trunk/; revision=13695
Diffstat (limited to 'mail/mail-mt.c')
-rw-r--r--mail/mail-mt.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/mail/mail-mt.c b/mail/mail-mt.c
index e9803a80e3..0892688853 100644
--- a/mail/mail-mt.c
+++ b/mail/mail-mt.c
@@ -770,12 +770,16 @@ struct _proxy_msg {
void *data;
};
+static int mail_proxy_event_current = -1;
+
static void
do_proxy_event(struct _mail_msg *mm)
{
struct _proxy_msg *m = (struct _proxy_msg *)mm;
+ mail_proxy_event_current = mm->seq;
m->func(m->o, m->event_data, m->data);
+ mail_proxy_event_current = -1;
}
struct _mail_msg_op proxy_event_op = {
@@ -785,6 +789,12 @@ struct _mail_msg_op proxy_event_op = {
NULL,
};
+/* returns the current id of the executing proxy event */
+int mail_proxy_event_id(void)
+{
+ return mail_proxy_event_current;
+}
+
int mail_proxy_event(CamelObjectEventHookFunc func, CamelObject *o, void *event_data, void *data)
{
struct _proxy_msg *m;
@@ -792,7 +802,11 @@ int mail_proxy_event(CamelObjectEventHookFunc func, CamelObject *o, void *event_
int ismain = pthread_self() == mail_gui_thread;
if (ismain) {
+ /* save the current id incase we're proxying an event in a proxied event */
+ id = mail_proxy_event_current;
+ mail_proxy_event_current = -1;
func(o, event_data, data);
+ mail_proxy_event_current = id;
/* id of -1 is 'always finished' */
return -1;
} else {