GNOME Bugzilla – Bug 608766
Replace pthread with GLib's GThread
Last modified: 2013-09-14 16:53:41 UTC
As discussed on IRC couple times, the evo code should rather use GLib's GThread than pthread directly, which will also help with portability (on Windows for example). The only issue is that the GThread doesn't support cancelling, but it's probably better, because it is causing issues with libraries, like shown in bug #606813
Created attachment 152809 [details] [review] proposed eds patch for evolution-data-server; Note I removed few deprecated functions from e-msgport.h/.c. They were deprecated for few releases, so should be fine to finally get rid of them (and makes this change much simpler to me).
Created attachment 152810 [details] [review] proposed evo patch for evolution;
Created attachment 152811 [details] [review] proposed eex patch for evolution-exchange;
Created attachment 152812 [details] [review] proposed ema patch for evolution-mapi;
Fridrich, could you give these a try, how it'll go on your build environment, please?
(In reply to comment #1) > Note I removed few deprecated functions from e-msgport.h/.c. They were > deprecated for few releases, so should be fine to finally get rid of them (and > makes this change much simpler to me). Big +1 on this effort, but we should wait until 2.31 to remove any deprecated functions from E-D-S, as it will require soname bumps on shared libraries. Once 2.30 ships, we can expunge old cruft to our heart's content.
Review of attachment 152810 [details] [review]: I wonder if the segv_redirect() code is still needed at all. Since libgnomebreakpad is a GTK+ module, it can handle exception signals like SEGV directly in-process, whereas Bug-Buddy from ages past could not. So I would guess that means it can obtain stacktraces more easily, even in a multi-threaded environment.
Review of attachment 152809 [details] [review]: In camel-net-utils.c, instead of replacing pthread_testcancel() with a boolean flag you might consider using GCancellable, which is thread-safe. I'll be adding GCancellables everywhere in Camel soon anyway.
(In reply to comment #6) > Big +1 on this effort, but we should wait until 2.31 to remove any deprecated > functions from E-D-S, as it will require soname bumps on shared libraries. > Once 2.30 ships, we can expunge old cruft to our heart's content. Yup, understood, just had mood for such coding. (In reply to comment #7) > I wonder if the segv_redirect() code is still needed at all. yeah, wasn't sure here, would test it when the time comes. (In reply to comment #8) > In camel-net-utils.c, instead of replacing pthread_testcancel() with a boolean > flag you might consider using GCancellable, which is thread-safe. I'll be > adding GCancellables everywhere in Camel soon anyway. So, it is how the msgport is working now. If you'll change it anyway, then even better, the part will be changed. Note the same check was done few lines below my changes.
(In reply to comment #9) > So, it is how the msgport is working now. If you'll change it anyway, then even > better, the part will be changed. Note the same check was done few lines below > my changes. Ah okay, works for me then. I admit to not reading the whole patch carefully. :)
Created commit e01898b in eds master (2.31.1+) Created commit 200f6ec in evo master (2.31.1+) Created commit df8e537 in eex master (2.31.1+) Created commit f8f909f in ema master (0.31.1+)