diff --git a/evolution-2.8.1-kill-ethread.patch b/evolution-2.8.1-kill-ethread.patch index 1a02390..0c0b312 100644 --- a/evolution-2.8.1-kill-ethread.patch +++ b/evolution-2.8.1-kill-ethread.patch @@ -1,5 +1,5 @@ ---- evolution-2.9.91/mail/mail-send-recv.c.kill-ethread 2007-01-03 10:27:18.000000000 -0500 -+++ evolution-2.9.91/mail/mail-send-recv.c 2007-02-15 16:04:42.000000000 -0500 +--- evolution-2.10.1/mail/mail-send-recv.c.kill-ethread 2007-04-09 09:09:27.000000000 -0400 ++++ evolution-2.10.1/mail/mail-send-recv.c 2007-04-10 22:37:49.000000000 -0400 @@ -819,7 +819,7 @@ m->folders = folders; m->info = sinfo; @@ -9,8 +9,8 @@ } else { receive_done ("", data); } ---- evolution-2.9.91/mail/mail-component.c.kill-ethread 2007-01-03 10:27:18.000000000 -0500 -+++ evolution-2.9.91/mail/mail-component.c 2007-02-15 16:04:42.000000000 -0500 +--- evolution-2.10.1/mail/mail-component.c.kill-ethread 2007-04-09 09:09:27.000000000 -0400 ++++ evolution-2.10.1/mail/mail-component.c 2007-04-10 22:37:49.000000000 -0400 @@ -965,7 +965,7 @@ if (camel_url_get_param(url, "uid") != NULL) { char *curi = em_uri_to_camel(uri); @@ -20,8 +20,8 @@ g_free(curi); } else { g_warning("email uri's must include a uid parameter"); ---- evolution-2.9.91/mail/mail-ops.c.kill-ethread 2007-01-03 10:27:18.000000000 -0500 -+++ evolution-2.9.91/mail/mail-ops.c 2007-02-15 16:04:42.000000000 -0500 +--- evolution-2.10.1/mail/mail-ops.c.kill-ethread 2007-04-09 09:09:27.000000000 -0400 ++++ evolution-2.10.1/mail/mail-ops.c 2007-04-10 22:37:49.000000000 -0400 @@ -221,7 +221,7 @@ camel_filter_driver_remove_rule_by_name (m->driver, "new-mail-notification"); } @@ -247,8 +247,8 @@ return id; } ---- evolution-2.9.91/mail/em-folder-utils.c.kill-ethread 2007-01-03 10:27:18.000000000 -0500 -+++ evolution-2.9.91/mail/em-folder-utils.c 2007-02-15 16:04:42.000000000 -0500 +--- evolution-2.10.1/mail/em-folder-utils.c.kill-ethread 2007-04-09 09:09:27.000000000 -0400 ++++ evolution-2.10.1/mail/em-folder-utils.c 2007-04-10 22:37:49.000000000 -0400 @@ -260,7 +260,7 @@ m->delete = delete; seq = m->msg.seq; @@ -267,8 +267,8 @@ return id; } ---- evolution-2.9.91/mail/importers/elm-importer.c.kill-ethread 2007-01-03 10:27:16.000000000 -0500 -+++ evolution-2.9.91/mail/importers/elm-importer.c 2007-02-15 16:04:42.000000000 -0500 +--- evolution-2.10.1/mail/importers/elm-importer.c.kill-ethread 2007-04-09 09:09:26.000000000 -0400 ++++ evolution-2.10.1/mail/importers/elm-importer.c 2007-04-10 22:37:49.000000000 -0400 @@ -312,7 +312,7 @@ id = m->msg.seq; @@ -278,8 +278,8 @@ return id; } ---- evolution-2.9.91/mail/importers/mail-importer.c.kill-ethread 2007-01-03 10:27:16.000000000 -0500 -+++ evolution-2.9.91/mail/importers/mail-importer.c 2007-02-15 16:04:42.000000000 -0500 +--- evolution-2.10.1/mail/importers/mail-importer.c.kill-ethread 2007-04-09 09:09:26.000000000 -0400 ++++ evolution-2.10.1/mail/importers/mail-importer.c 2007-04-10 22:37:49.000000000 -0400 @@ -329,7 +329,7 @@ } @@ -289,8 +289,8 @@ return id; } ---- evolution-2.9.91/mail/importers/pine-importer.c.kill-ethread 2007-01-03 10:27:16.000000000 -0500 -+++ evolution-2.9.91/mail/importers/pine-importer.c 2007-02-15 16:04:42.000000000 -0500 +--- evolution-2.10.1/mail/importers/pine-importer.c.kill-ethread 2007-04-09 09:09:26.000000000 -0400 ++++ evolution-2.10.1/mail/importers/pine-importer.c 2007-04-10 22:37:49.000000000 -0400 @@ -350,7 +350,7 @@ id = m->msg.seq; @@ -300,8 +300,8 @@ return id; } ---- evolution-2.9.91/mail/mail-vfolder.c.kill-ethread 2007-01-03 10:27:18.000000000 -0500 -+++ evolution-2.9.91/mail/mail-vfolder.c 2007-02-15 16:04:42.000000000 -0500 +--- evolution-2.10.1/mail/mail-vfolder.c.kill-ethread 2007-04-09 09:09:27.000000000 -0400 ++++ evolution-2.10.1/mail/mail-vfolder.c 2007-04-10 22:37:49.000000000 -0400 @@ -188,7 +188,7 @@ m->sources_folder = sources_folder; @@ -347,9 +347,9 @@ from = em_uri_from_camel(cfrom); to = em_uri_from_camel(cto); ---- evolution-2.9.91/mail/em-format-html.c.kill-ethread 2007-01-03 10:27:18.000000000 -0500 -+++ evolution-2.9.91/mail/em-format-html.c 2007-02-15 16:04:42.000000000 -0500 -@@ -1374,7 +1374,7 @@ +--- evolution-2.10.1/mail/em-format-html.c.kill-ethread 2007-04-09 09:09:27.000000000 -0400 ++++ evolution-2.10.1/mail/em-format-html.c 2007-04-10 22:37:49.000000000 -0400 +@@ -1375,7 +1375,7 @@ } efh->priv->format_id = m->msg.seq; @@ -358,9 +358,9 @@ } efh->priv->format_timeout_id = 0; ---- evolution-2.9.91/mail/em-folder-properties.c.kill-ethread 2007-01-03 10:27:18.000000000 -0500 -+++ evolution-2.9.91/mail/em-folder-properties.c 2007-02-15 16:04:42.000000000 -0500 -@@ -379,7 +379,7 @@ +--- evolution-2.10.1/mail/em-folder-properties.c.kill-ethread 2007-04-09 09:09:27.000000000 -0400 ++++ evolution-2.10.1/mail/em-folder-properties.c 2007-04-10 22:37:49.000000000 -0400 +@@ -386,7 +386,7 @@ } if (folder == NULL) @@ -369,9 +369,9 @@ else emfp_dialog_got_folder((char *)uri, folder, NULL); } ---- evolution-2.9.91/mail/em-folder-tree.c.kill-ethread 2007-01-03 10:27:18.000000000 -0500 -+++ evolution-2.9.91/mail/em-folder-tree.c 2007-02-15 16:04:42.000000000 -0500 -@@ -966,7 +966,7 @@ +--- evolution-2.10.1/mail/em-folder-tree.c.kill-ethread 2007-04-09 09:09:27.000000000 -0400 ++++ evolution-2.10.1/mail/em-folder-tree.c 2007-04-10 22:37:49.000000000 -0400 +@@ -969,7 +969,7 @@ tree_drag_data_action(struct _DragDataReceivedAsync *m) { m->move = m->action == GDK_ACTION_MOVE; @@ -380,7 +380,7 @@ } static void -@@ -1891,7 +1891,7 @@ +@@ -1915,7 +1915,7 @@ m->top = full_name; m->flags = CAMEL_STORE_FOLDER_INFO_RECURSIVE|CAMEL_STORE_FOLDER_INFO_FAST; @@ -389,8 +389,8 @@ } static gboolean ---- evolution-2.9.91/mail/em-folder-browser.c.kill-ethread 2007-02-12 05:37:31.000000000 -0500 -+++ evolution-2.9.91/mail/em-folder-browser.c 2007-02-15 16:04:42.000000000 -0500 +--- evolution-2.10.1/mail/em-folder-browser.c.kill-ethread 2007-04-09 09:09:27.000000000 -0400 ++++ evolution-2.10.1/mail/em-folder-browser.c 2007-04-10 22:37:49.000000000 -0400 @@ -948,7 +948,7 @@ m->sources_folder = sources_folder; @@ -400,9 +400,9 @@ return id; } ---- evolution-2.9.91/mail/message-list.c.kill-ethread 2007-01-18 07:31:51.000000000 -0500 -+++ evolution-2.9.91/mail/message-list.c 2007-02-15 16:04:42.000000000 -0500 -@@ -1888,7 +1888,7 @@ +--- evolution-2.10.1/mail/message-list.c.kill-ethread 2007-04-09 09:09:27.000000000 -0400 ++++ evolution-2.10.1/mail/message-list.c 2007-04-10 22:37:49.000000000 -0400 +@@ -1889,7 +1889,7 @@ ml_drop_action(struct _drop_msg *m) { m->move = m->action == GDK_ACTION_MOVE; @@ -411,7 +411,7 @@ } static void -@@ -3922,7 +3922,7 @@ +@@ -3978,7 +3978,7 @@ m->ml->regen = g_list_prepend(m->ml->regen, m); /* TODO: we should manage our own thread stuff, would make cancelling outstanding stuff easier */ @@ -420,8 +420,8 @@ m->ml->regen_timeout_msg = NULL; m->ml->regen_timeout_id = 0; ---- evolution-2.9.91/mail/em-format-html-print.c.kill-ethread 2007-02-12 01:58:01.000000000 -0500 -+++ evolution-2.9.91/mail/em-format-html-print.c 2007-02-15 16:04:42.000000000 -0500 +--- evolution-2.10.1/mail/em-format-html-print.c.kill-ethread 2007-04-09 09:09:27.000000000 -0400 ++++ evolution-2.10.1/mail/em-format-html-print.c 2007-04-10 22:37:49.000000000 -0400 @@ -262,7 +262,7 @@ g_object_ref(source); g_object_ref(efhp); @@ -431,37 +431,8 @@ return 0; /* damn async ... */ } ---- evolution-2.9.91/mail/em-sync-stream.c.kill-ethread 2007-02-09 15:16:33.000000000 -0500 -+++ evolution-2.9.91/mail/em-sync-stream.c 2007-02-15 16:04:42.000000000 -0500 -@@ -268,7 +268,7 @@ - if (emss->cancel) - return -1; - -- if (pthread_equal(pthread_self(), mail_gui_thread)) { -+ if (mail_in_main_thread ()) { - EMSS_CLASS(emss)->sync_write(stream, buffer, n); - #ifdef LOG_STREAM - if (p->logfd) -@@ -298,7 +298,7 @@ - if (emss->cancel) - return -1; - -- if (pthread_equal(pthread_self(), mail_gui_thread)) -+ if (mail_in_main_thread ()) - return ((EMSyncStreamClass *)(((CamelObject *)emss)->klass))->sync_flush(stream); - else - sync_op(emss, EMSS_FLUSH, NULL, 0); -@@ -316,7 +316,7 @@ - - d(printf("%p: closing stream\n", stream)); - -- if (pthread_equal(pthread_self(), mail_gui_thread)) { -+ if (mail_in_main_thread ()) { - #ifdef LOG_STREAM - if (emss->priv->logfd) { - fclose(emss->priv->logfd); ---- evolution-2.9.91/mail/em-subscribe-editor.c.kill-ethread 2007-01-08 11:35:48.000000000 -0500 -+++ evolution-2.9.91/mail/em-subscribe-editor.c 2007-02-15 16:04:42.000000000 -0500 +--- evolution-2.10.1/mail/em-subscribe-editor.c.kill-ethread 2007-04-09 09:09:27.000000000 -0400 ++++ evolution-2.10.1/mail/em-subscribe-editor.c 2007-04-10 22:37:49.000000000 -0400 @@ -229,7 +229,7 @@ next = (struct _zsubscribe_msg *)e_dlist_remhead(&m->sub->subscribe); if (next) { @@ -489,25 +460,38 @@ return id; } ---- evolution-2.9.91/mail/mail-mt.h.kill-ethread 2007-01-03 10:27:18.000000000 -0500 -+++ evolution-2.9.91/mail/mail-mt.h 2007-02-15 16:04:42.000000000 -0500 -@@ -33,6 +33,7 @@ - EMsg msg; /* parent type */ +--- evolution-2.10.1/mail/mail-mt.h.kill-ethread 2007-04-09 09:09:27.000000000 -0400 ++++ evolution-2.10.1/mail/mail-mt.h 2007-04-10 22:37:49.000000000 -0400 +@@ -25,14 +25,15 @@ + + #include + #include "camel/camel-exception.h" +-#include "libedataserver/e-msgport.h" ++#include "libedataserver/e-flag.h" + #include "camel/camel-object.h" + #include "camel/camel-operation.h" + + typedef struct _mail_msg { +- EMsg msg; /* parent type */ ++ EFlag *processed; /* optional */ struct _mail_msg_op *ops; /* operation functions */ unsigned int seq; /* seq number for synchronisation */ + gint priority; /* priority (default = 0) */ CamelOperation *cancel; /* a cancellation/status handle */ CamelException ex; /* an initialised camel exception, upto the caller to use this */ struct _mail_msg_priv *priv; /* private for internal use */ -@@ -51,6 +52,8 @@ +@@ -51,8 +52,10 @@ void mail_msg_init(void); void mail_msg_cleanup (void); +gboolean mail_in_main_thread (void); + /* allocate a new message */ - void *mail_msg_new(mail_msg_op_t *ops, EMsgPort *reply_port, size_t size); +-void *mail_msg_new(mail_msg_op_t *ops, EMsgPort *reply_port, size_t size); ++void *mail_msg_new(mail_msg_op_t *ops, EFlag *processed, size_t size); void mail_msg_free(void *msg); + void mail_msg_check_error(void *msg); + void mail_msg_cancel(unsigned int msgid); @@ -60,6 +63,14 @@ void mail_msg_wait_all(void); int mail_msg_active(unsigned int msgid); @@ -548,9 +532,9 @@ /* A generic proxy event for anything that can be proxied during the life of the mailer (almost nothing) */ /* Note that almost all objects care about the lifecycle of their events, so this cannot be used */ extern MailAsyncEvent *mail_async_event; ---- evolution-2.9.91/mail/mail-ops.h.kill-ethread 2007-01-03 10:27:18.000000000 -0500 -+++ evolution-2.9.91/mail/mail-ops.h 2007-02-15 16:04:42.000000000 -0500 -@@ -30,6 +30,8 @@ +--- evolution-2.10.1/mail/mail-ops.h.kill-ethread 2007-04-09 09:09:27.000000000 -0400 ++++ evolution-2.10.1/mail/mail-ops.h 2007-04-10 22:37:49.000000000 -0400 +@@ -30,13 +30,14 @@ #pragma } #endif /* __cplusplus */ @@ -559,7 +543,14 @@ #include "camel/camel-store.h" #include "camel/camel-folder.h" #include "camel/camel-filter-driver.h" -@@ -55,12 +57,12 @@ + #include "camel/camel-mime-message.h" + #include "camel/camel-operation.h" + +-#include "libedataserver/e-msgport.h" + #include "libedataserver/e-account.h" + + void mail_append_mail (CamelFolder *folder, CamelMimeMessage *message, CamelMessageInfo *info, +@@ -55,12 +56,12 @@ void mail_get_message (CamelFolder *folder, const char *uid, void (*done) (CamelFolder *folder, const char *uid, CamelMimeMessage *msg, void *data), void *data, @@ -574,7 +565,7 @@ /* get several messages */ void mail_get_messages (CamelFolder *folder, GPtrArray *uids, -@@ -70,7 +72,7 @@ +@@ -70,7 +71,7 @@ /* same for a folder */ int mail_get_folder (const char *uri, guint32 flags, void (*done) (char *uri, CamelFolder *folder, void *data), void *data, @@ -583,8 +574,8 @@ /* and for a store */ int mail_get_store (const char *uri, CamelOperation *op, ---- evolution-2.9.91/mail/em-composer-utils.c.kill-ethread 2007-01-03 10:27:18.000000000 -0500 -+++ evolution-2.9.91/mail/em-composer-utils.c 2007-02-15 16:04:42.000000000 -0500 +--- evolution-2.10.1/mail/em-composer-utils.c.kill-ethread 2007-04-09 09:09:27.000000000 -0400 ++++ evolution-2.10.1/mail/em-composer-utils.c 2007-04-10 22:37:49.000000000 -0400 @@ -534,7 +534,7 @@ strcmp (account->drafts_folder_uri, default_drafts_folder_uri) != 0) { int id; @@ -628,8 +619,8 @@ - mail_get_message (folder, uid, post_reply_to_message, NULL, mail_thread_new); + mail_get_message (folder, uid, post_reply_to_message, NULL, mail_msg_unordered_push); } ---- evolution-2.9.91/mail/mail-folder-cache.c.kill-ethread 2007-01-03 10:27:18.000000000 -0500 -+++ evolution-2.9.91/mail/mail-folder-cache.c 2007-02-15 16:04:42.000000000 -0500 +--- evolution-2.10.1/mail/mail-folder-cache.c.kill-ethread 2007-04-09 09:09:27.000000000 -0400 ++++ evolution-2.10.1/mail/mail-folder-cache.c 2007-04-10 22:37:49.000000000 -0400 @@ -907,7 +907,7 @@ m->store = store; camel_object_ref (store); @@ -648,9 +639,17 @@ LOCK(info_lock); ---- evolution-2.9.91/mail/em-folder-view.c.kill-ethread 2007-02-12 01:58:01.000000000 -0500 -+++ evolution-2.9.91/mail/em-folder-view.c 2007-02-15 16:04:42.000000000 -0500 -@@ -693,7 +693,7 @@ +--- evolution-2.10.1/mail/em-folder-view.c.kill-ethread 2007-04-09 09:09:27.000000000 -0400 ++++ evolution-2.10.1/mail/em-folder-view.c 2007-04-10 22:37:49.000000000 -0400 +@@ -68,6 +68,7 @@ + #include + + #include ++#include + + #include "menus/gal-view-etable.h" + #include "menus/gal-view-factory-etable.h" +@@ -693,7 +694,7 @@ static void emfv_set_folder_uri(EMFolderView *emfv, const char *uri) { @@ -659,7 +658,7 @@ } static void -@@ -1611,7 +1611,7 @@ +@@ -1613,7 +1614,7 @@ data->type = type; data->source = source; @@ -668,7 +667,7 @@ } static void -@@ -1709,7 +1709,7 @@ +@@ -1711,7 +1712,7 @@ data->type = type; data->uri = g_strdup (uri); @@ -677,7 +676,7 @@ } static void -@@ -2369,7 +2369,7 @@ +@@ -2370,7 +2371,7 @@ g_object_ref (emfv); /* TODO: we should manage our own thread stuff, would make cancelling outstanding stuff easier */ e_profile_event_emit("goto.load", emfv->displayed_uid, 0); @@ -686,18 +685,145 @@ } else { e_profile_event_emit("goto.empty", "", 0); g_free(emfv->priv->selected_uid); ---- evolution-2.9.91/mail/mail-session.c.kill-ethread 2007-02-15 16:04:42.000000000 -0500 -+++ evolution-2.9.91/mail/mail-session.c 2007-02-15 16:04:42.000000000 -0500 -@@ -374,7 +374,7 @@ - if (cancel) - user_message_reply = e_msgport_new (); - m = mail_msg_new (&user_message_op, user_message_reply, sizeof (*m)); +--- evolution-2.10.1/mail/mail-session.c.kill-ethread 2007-04-09 09:09:27.000000000 -0400 ++++ evolution-2.10.1/mail/mail-session.c 2007-04-10 22:37:49.000000000 -0400 +@@ -35,7 +35,7 @@ + #include + + #include +-#include ++#include + + #include /* FIXME: this is where camel_init is defined, it shouldn't include everything else */ + #include +@@ -256,7 +256,7 @@ + + /* ********************************************************************** */ + +-static GtkDialog *message_dialog; ++static gpointer message_dialog; + static EDList message_list = E_DLIST_INITIALISER(message_list); + + struct _user_message_msg { +@@ -283,7 +283,7 @@ + /* if !allow_cancel, then we've already replied */ + if (m->allow_cancel) { + m->result = button == GTK_RESPONSE_OK; +- e_msgport_reply((EMsg *)m); ++ e_flag_set (m->msg.processed); + } + + /* check for pendings */ +@@ -292,22 +292,10 @@ + } + + static void +-user_message_destroy_notify (struct _user_message_msg *m, GObject *deadbeef) +-{ +- message_dialog = NULL; +-} +- +-/* This is kinda ugly/inefficient, but oh well, it works */ +-static const char *error_type[] = { +- "mail:session-message-info", "mail:session-message-warning", "mail:session-message-error", +- "mail:session-message-info-cancel", "mail:session-message-warning-cancel", "mail:session-message-error-cancel" +-}; +- +-static void + do_user_message (struct _mail_msg *mm) + { + struct _user_message_msg *m = (struct _user_message_msg *)mm; +- int type; ++ const gchar *error_type; + + if (!m->ismain && message_dialog != NULL) { + e_dlist_addtail (&message_list, (EDListNode *)m); +@@ -315,24 +303,27 @@ + } + + switch (m->type) { +- case CAMEL_SESSION_ALERT_INFO: +- type = 0; +- break; +- case CAMEL_SESSION_ALERT_WARNING: +- type = 1; +- break; +- case CAMEL_SESSION_ALERT_ERROR: +- type = 2; +- break; +- default: +- type = 0; ++ case CAMEL_SESSION_ALERT_INFO: ++ error_type = m->allow_cancel ? ++ "mail:session-message-info-cancel" : ++ "mail:session-message-info"; ++ break; ++ case CAMEL_SESSION_ALERT_WARNING: ++ error_type = m->allow_cancel ? ++ "mail:session-message-warning-cancel" : ++ "mail:session-message-warning"; ++ break; ++ case CAMEL_SESSION_ALERT_ERROR: ++ error_type = m->allow_cancel ? ++ "mail:session-message-error-cancel" : ++ "mail:session-message-error"; ++ break; ++ default: ++ g_assert_not_reached (); + } + +- if (m->allow_cancel) +- type += 3; +- +- message_dialog = (GtkDialog *)e_error_new(NULL, error_type[type], m->prompt, NULL); +- g_object_set ((GObject *) message_dialog, "allow_shrink", TRUE, "allow_grow", TRUE, NULL); ++ message_dialog = e_error_new(NULL, error_type, m->prompt, NULL); ++ g_object_set (message_dialog, "allow_shrink", TRUE, "allow_grow", TRUE, NULL); + + /* We only need to wait for the result if we allow cancel otherwise show but send result back instantly */ + if (m->allow_cancel) { +@@ -340,12 +331,13 @@ + user_message_response(message_dialog, gtk_dialog_run (message_dialog), m); + } else { + g_signal_connect (message_dialog, "response", G_CALLBACK (user_message_response), m); +- gtk_widget_show ((GtkWidget *) message_dialog); ++ gtk_widget_show (message_dialog); + } + } else { + g_signal_connect (message_dialog, "response", G_CALLBACK (gtk_widget_destroy), message_dialog); +- g_object_weak_ref ((GObject *) message_dialog, (GWeakNotify) user_message_destroy_notify, m); +- gtk_widget_show ((GtkWidget *) message_dialog); ++ g_object_add_weak_pointer (message_dialog, &message_dialog); ++ gtk_widget_show (message_dialog); ++ e_flag_free (mm->processed); + mail_msg_free(m); + } + } +@@ -364,17 +356,17 @@ + alert_user(CamelSession *session, CamelSessionAlertType type, const char *prompt, gboolean cancel) + { + MailSession *mail_session = MAIL_SESSION (session); +- struct _user_message_msg *m, *r; +- EMsgPort *user_message_reply = NULL; ++ struct _user_message_msg *m; ++ EFlag *processed = NULL; + gboolean ret; + + if (!mail_session->interactive) + return FALSE; + +- if (cancel) +- user_message_reply = e_msgport_new (); +- m = mail_msg_new (&user_message_op, user_message_reply, sizeof (*m)); - m->ismain = pthread_equal(pthread_self(), mail_gui_thread); ++ processed = e_flag_new (); ++ ++ m = mail_msg_new (&user_message_op, processed, sizeof (*m)); + m->ismain = mail_in_main_thread(); m->type = type; m->prompt = g_strdup(prompt); m->allow_cancel = cancel; -@@ -382,9 +382,7 @@ +@@ -382,18 +374,14 @@ if (m->ismain) do_user_message((struct _mail_msg *)m); else { @@ -708,9 +834,37 @@ } if (cancel) { ---- evolution-2.9.91/mail/mail-mt.c.kill-ethread 2007-01-03 10:27:18.000000000 -0500 -+++ evolution-2.9.91/mail/mail-mt.c 2007-02-15 16:28:12.000000000 -0500 -@@ -82,12 +82,8 @@ +- r = (struct _user_message_msg *)e_msgport_wait(user_message_reply); +- g_assert(m == r); +- ++ e_flag_wait (processed); ++ e_flag_free (processed); + ret = m->result; + mail_msg_free(m); +- e_msgport_destroy(user_message_reply); + } else + ret = TRUE; + +@@ -687,7 +675,7 @@ + /* flush/cancel pending user messages */ + while ((um = (struct _user_message_msg *) e_dlist_remhead (&message_list))) { + d(printf ("Flusing message request: %s\n", um->prompt)); +- e_msgport_reply((EMsg *) um); ++ e_flag_set (um->msg.processed); + } + + /* and the current */ +--- evolution-2.10.1/mail/mail-mt.c.kill-ethread 2007-04-09 09:09:27.000000000 -0400 ++++ evolution-2.10.1/mail/mail-mt.c 2007-04-10 22:37:49.000000000 -0400 +@@ -29,7 +29,6 @@ + #include + #include + +-#include + #include + + #include +@@ -82,13 +81,9 @@ static pthread_mutex_t mail_msg_lock = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t mail_msg_cond = PTHREAD_COND_INITIALIZER; @@ -720,10 +874,12 @@ -static void mail_msg_destroy(EThread *e, EMsg *msg, void *data); - - void *mail_msg_new(mail_msg_op_t *ops, EMsgPort *reply_port, size_t size) +-void *mail_msg_new(mail_msg_op_t *ops, EMsgPort *reply_port, size_t size) ++void *mail_msg_new(mail_msg_op_t *ops, EFlag *processed, size_t size) { struct _mail_msg *msg; -@@ -112,7 +108,6 @@ + +@@ -112,7 +107,6 @@ fprintf(log, "Logging async operations\n"); if (log_locks) { @@ -731,7 +887,18 @@ fprintf(log, "%" G_GINT64_MODIFIER "x: lock mail_msg_lock\n", e_util_pthread_id(pthread_self())); } } else { -@@ -308,9 +303,8 @@ +@@ -123,9 +117,9 @@ + } + #endif + msg = g_malloc0(size); ++ msg->processed = processed; /* owned by caller */ + msg->ops = ops; + msg->seq = mail_msg_seq++; +- msg->msg.reply_port = reply_port; + msg->cancel = camel_operation_new(mail_operation_status, GINT_TO_POINTER(msg->seq)); + camel_exception_init(&msg->ex); + msg->priv = g_malloc0(sizeof(*msg->priv)); +@@ -308,9 +302,8 @@ void mail_msg_wait(unsigned int msgid) { struct _mail_msg *m; @@ -742,7 +909,7 @@ MAIL_MT_LOCK(mail_msg_lock); m = g_hash_table_lookup(mail_msg_active_table, GINT_TO_POINTER(msgid)); while (m) { -@@ -347,9 +341,7 @@ +@@ -347,9 +340,7 @@ void mail_msg_wait_all(void) { @@ -753,7 +920,7 @@ MAIL_MT_LOCK(mail_msg_lock); while (g_hash_table_size(mail_msg_active_table) > 0) { MAIL_MT_UNLOCK(mail_msg_lock); -@@ -420,241 +412,193 @@ +@@ -420,241 +411,193 @@ MAIL_MT_UNLOCK(mail_msg_lock); } @@ -829,11 +996,11 @@ + /* check the main loop queue */ + while ((msg = g_async_queue_try_pop (main_loop_queue)) != NULL) { + -+ /* If the message has a reply_port, it must also have a -+ * receive_msg() callback. The receive_msg() callback is -+ * responsible for issuing the reply, and the recipient of -+ * the reply is responsible for freeing the message. */ -+ if (msg->msg.reply_port != NULL) { ++ /* If the message has a "processed" EFlag, it must also have ++ * a receive_msg() callback. The receive_msg() callback is ++ * responsible for setting the EFlag, and thread blocked on ++ * the EFlag is reponsible for freeing it. */ ++ if (msg->processed != NULL) { + g_assert (msg->ops->receive_msg != NULL); + msg->ops->receive_msg (msg); + } else { @@ -1131,7 +1298,7 @@ } /* ********************************************************************** */ -@@ -723,7 +667,6 @@ +@@ -723,7 +666,6 @@ { struct _proxy_msg *m; int id; @@ -1139,7 +1306,7 @@ /* we dont have a reply port for this, we dont care when/if it gets executed, just queue it */ m = mail_msg_new(&async_event_op, NULL, sizeof(*m)); -@@ -743,12 +686,12 @@ +@@ -743,12 +685,12 @@ /* We use an idle function instead of our own message port only because the gui message ports's notification buffer might overflow and deadlock us */ if (type == MAIL_ASYNC_GUI) { @@ -1155,41 +1322,49 @@ return id; } -@@ -842,6 +785,9 @@ +@@ -842,6 +784,9 @@ m->ret = m->func(p1, p2, i1, p3, p4, p5); break; } + -+ if (mm->msg.reply_port != NULL) -+ e_msgport_reply ((EMsg *) mm); ++ if (mm->processed != NULL) ++ e_flag_set (mm->processed); } static struct _mail_msg_op mail_call_op = { -@@ -857,11 +803,10 @@ +@@ -856,23 +801,22 @@ + struct _call_msg *m; void *ret; va_list ap; - EMsgPort *reply = NULL; +- EMsgPort *reply = NULL; - int ismain = pthread_equal(pthread_self(), mail_gui_thread); ++ EFlag *processed = NULL; va_start(ap, func); - if (!ismain) +- reply = e_msgport_new(); + if (!mail_in_main_thread ()) - reply = e_msgport_new(); ++ processed = e_flag_new (); - m = mail_msg_new(&mail_call_op, reply, sizeof(*m)); -@@ -869,8 +814,8 @@ +- m = mail_msg_new(&mail_call_op, reply, sizeof(*m)); ++ m = mail_msg_new(&mail_call_op, processed, sizeof(*m)); + m->type = type; m->func = func; G_VA_COPY(m->ap, ap); - if (!ismain) { - e_msgport_put(mail_gui_port, (EMsg *)m); -+ if (reply != NULL) { +- e_msgport_wait(reply); +- e_msgport_destroy(reply); ++ if (processed != NULL) { + mail_msg_main_loop_push((mail_msg_t *) m); - e_msgport_wait(reply); - e_msgport_destroy(reply); ++ e_flag_wait (processed); ++ e_flag_free (processed); } else { -@@ -909,7 +854,7 @@ + do_call(&m->msg); + } +@@ -909,7 +853,7 @@ busy_state++; if (busy_state == 1) { m = mail_msg_new(&set_busy_op, NULL, sizeof(*m)); @@ -1198,7 +1373,7 @@ } MAIL_MT_UNLOCK(status_lock); } -@@ -922,7 +867,7 @@ +@@ -922,7 +866,7 @@ busy_state--; if (busy_state == 0) { m = mail_msg_new(&set_busy_op, NULL, sizeof(*m)); @@ -1207,7 +1382,7 @@ } MAIL_MT_UNLOCK(status_lock); } -@@ -947,7 +892,7 @@ +@@ -947,7 +891,7 @@ char *out, *p, *o, c; int pc; @@ -1216,7 +1391,7 @@ MAIL_MT_LOCK (mail_msg_lock); -@@ -1055,7 +1000,7 @@ +@@ -1055,7 +999,7 @@ } m->pc = pc; m->data = data; @@ -1225,8 +1400,8 @@ } /* ******************** */ ---- evolution-2.9.91/plugins/folder-unsubscribe/folder-unsubscribe.c.kill-ethread 2007-01-03 10:27:06.000000000 -0500 -+++ evolution-2.9.91/plugins/folder-unsubscribe/folder-unsubscribe.c 2007-02-15 16:04:42.000000000 -0500 +--- evolution-2.10.1/plugins/folder-unsubscribe/folder-unsubscribe.c.kill-ethread 2007-04-09 09:09:11.000000000 -0400 ++++ evolution-2.10.1/plugins/folder-unsubscribe/folder-unsubscribe.c 2007-04-10 22:37:49.000000000 -0400 @@ -108,5 +108,5 @@ unsub = mail_msg_new (&unsubscribe_op, NULL, sizeof (struct _folder_unsub_t)); unsub->uri = g_strdup (target->uri); @@ -1234,8 +1409,8 @@ - e_thread_put (mail_thread_new, (EMsg *) unsub); + mail_msg_unordered_push ((mail_msg_t *) unsub); } ---- evolution-2.9.91/plugins/mark-all-read/mark-all-read.c.kill-ethread 2007-01-03 10:27:08.000000000 -0500 -+++ evolution-2.9.91/plugins/mark-all-read/mark-all-read.c 2007-02-15 16:04:42.000000000 -0500 +--- evolution-2.10.1/plugins/mark-all-read/mark-all-read.c.kill-ethread 2007-04-09 09:09:14.000000000 -0400 ++++ evolution-2.10.1/plugins/mark-all-read/mark-all-read.c 2007-04-10 22:37:49.000000000 -0400 @@ -44,7 +44,7 @@ return; } @@ -1245,8 +1420,8 @@ } static void ---- evolution-2.9.91/plugins/exchange-operations/exchange-folder.c.kill-ethread 2007-01-03 10:27:08.000000000 -0500 -+++ evolution-2.9.91/plugins/exchange-operations/exchange-folder.c 2007-02-15 16:04:42.000000000 -0500 +--- evolution-2.10.1/plugins/exchange-operations/exchange-folder.c.kill-ethread 2007-04-09 09:09:13.000000000 -0400 ++++ evolution-2.10.1/plugins/exchange-operations/exchange-folder.c 2007-04-10 22:37:49.000000000 -0400 @@ -134,7 +134,7 @@ inbox_physical_uri = e_folder_get_physical_uri (inbox); @@ -1256,8 +1431,8 @@ } ---- evolution-2.9.91/plugins/save-attachments/save-attachments.c.kill-ethread 2007-02-09 15:16:33.000000000 -0500 -+++ evolution-2.9.91/plugins/save-attachments/save-attachments.c 2007-02-15 16:04:42.000000000 -0500 +--- evolution-2.10.1/plugins/save-attachments/save-attachments.c.kill-ethread 2007-04-09 09:09:15.000000000 -0400 ++++ evolution-2.10.1/plugins/save-attachments/save-attachments.c 2007-04-10 22:37:49.000000000 -0400 @@ -407,5 +407,5 @@ camel_object_ref(data->folder); data->uid = g_strdup(target->uids->pdata[0]); @@ -1265,8 +1440,8 @@ - mail_get_message(data->folder, data->uid, save_got_message, data, mail_thread_new); + mail_get_message(data->folder, data->uid, save_got_message, data, mail_msg_unordered_push); } ---- evolution-2.9.91/plugins/mailing-list-actions/mailing-list-actions.c.kill-ethread 2007-01-03 10:27:09.000000000 -0500 -+++ evolution-2.9.91/plugins/mailing-list-actions/mailing-list-actions.c 2007-02-15 16:04:42.000000000 -0500 +--- evolution-2.10.1/plugins/mailing-list-actions/mailing-list-actions.c.kill-ethread 2007-04-09 09:09:14.000000000 -0400 ++++ evolution-2.10.1/plugins/mailing-list-actions/mailing-list-actions.c 2007-04-10 22:37:49.000000000 -0400 @@ -89,7 +89,7 @@ data->uri = strdup (sel->uri); @@ -1276,8 +1451,8 @@ } void emla_list_action_do (CamelFolder *folder, const char *uid, CamelMimeMessage *msg, void *data) ---- evolution-2.9.91/plugins/groupwise-features/share-folder-common.c.kill-ethread 2007-01-03 10:27:07.000000000 -0500 -+++ evolution-2.9.91/plugins/groupwise-features/share-folder-common.c 2007-02-15 16:04:42.000000000 -0500 +--- evolution-2.10.1/plugins/groupwise-features/share-folder-common.c.kill-ethread 2007-04-09 09:09:12.000000000 -0400 ++++ evolution-2.10.1/plugins/groupwise-features/share-folder-common.c 2007-04-10 22:37:49.000000000 -0400 @@ -239,7 +239,7 @@ m->done = done; g_free (namebuf); @@ -1287,8 +1462,8 @@ return id; } ---- evolution-2.9.91/calendar/gui/alarm-notify/alarm-notify.h.kill-ethread 2007-01-03 10:27:57.000000000 -0500 -+++ evolution-2.9.91/calendar/gui/alarm-notify/alarm-notify.h 2007-02-15 16:04:42.000000000 -0500 +--- evolution-2.10.1/calendar/gui/alarm-notify/alarm-notify.h.kill-ethread 2007-04-09 09:10:29.000000000 -0400 ++++ evolution-2.10.1/calendar/gui/alarm-notify/alarm-notify.h 2007-04-10 22:37:49.000000000 -0400 @@ -39,19 +39,6 @@ typedef struct _AlarmNotifyPrivate AlarmNotifyPrivate; @@ -1309,8 +1484,8 @@ struct _AlarmNotify { BonoboObject object; ---- evolution-2.9.91/calendar/gui/alarm-notify/alarm-notify.c.kill-ethread 2007-01-03 10:27:57.000000000 -0500 -+++ evolution-2.9.91/calendar/gui/alarm-notify/alarm-notify.c 2007-02-15 16:04:42.000000000 -0500 +--- evolution-2.10.1/calendar/gui/alarm-notify/alarm-notify.c.kill-ethread 2007-04-09 09:10:29.000000000 -0400 ++++ evolution-2.10.1/calendar/gui/alarm-notify/alarm-notify.c 2007-04-10 22:37:49.000000000 -0400 @@ -45,10 +45,6 @@ GMutex *mutex; }; @@ -1423,8 +1598,8 @@ } static void ---- evolution-2.9.91/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread 2007-01-03 10:27:57.000000000 -0500 -+++ evolution-2.9.91/calendar/gui/alarm-notify/alarm-queue.c 2007-02-15 16:04:42.000000000 -0500 +--- evolution-2.10.1/calendar/gui/alarm-notify/alarm-queue.c.kill-ethread 2007-04-09 09:10:29.000000000 -0400 ++++ evolution-2.10.1/calendar/gui/alarm-notify/alarm-queue.c 2007-04-10 22:37:49.000000000 -0400 @@ -115,9 +115,6 @@ static int tray_blink_state = FALSE; static AlarmNotify *an;