After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 608766 - Replace pthread with GLib's GThread
Replace pthread with GLib's GThread
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: general
2.30.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: Evolution Shell Maintainers Team
Evolution QA team
evolution[cleanup]
Depends on:
Blocks:
 
 
Reported: 2010-02-02 05:28 UTC by Milan Crha
Modified: 2013-09-14 16:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed eds patch (75.69 KB, patch)
2010-02-02 08:38 UTC, Milan Crha
committed Details | Review
proposed evo patch (2.25 KB, patch)
2010-02-02 08:39 UTC, Milan Crha
committed Details | Review
proposed eex patch (5.53 KB, patch)
2010-02-02 08:39 UTC, Milan Crha
committed Details | Review
proposed ema patch (1.52 KB, patch)
2010-02-02 08:40 UTC, Milan Crha
committed Details | Review

Description Milan Crha 2010-02-02 05:28:02 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
Comment 1 Milan Crha 2010-02-02 08:38:49 UTC
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).
Comment 2 Milan Crha 2010-02-02 08:39:11 UTC
Created attachment 152810 [details] [review]
proposed evo patch

for evolution;
Comment 3 Milan Crha 2010-02-02 08:39:41 UTC
Created attachment 152811 [details] [review]
proposed eex patch

for evolution-exchange;
Comment 4 Milan Crha 2010-02-02 08:40:12 UTC
Created attachment 152812 [details] [review]
proposed ema patch

for evolution-mapi;
Comment 5 Milan Crha 2010-02-02 08:41:36 UTC
Fridrich, could you give these a try, how it'll go on your build environment, please?
Comment 6 Matthew Barnes 2010-02-02 13:05:11 UTC
(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.
Comment 7 Matthew Barnes 2010-02-02 13:18:17 UTC
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.
Comment 8 Matthew Barnes 2010-02-02 13:31:35 UTC
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.
Comment 9 Milan Crha 2010-02-02 17:00:26 UTC
(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.
Comment 10 Matthew Barnes 2010-02-02 18:54:02 UTC
(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.  :)
Comment 11 Milan Crha 2010-04-15 12:48:51 UTC
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+)