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 727137 - Make e-categories.h API thread safe
Make e-categories.h API thread safe
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: general
3.12.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: Evolution Shell Maintainers Team
Evolution QA team
Depends on: 660535
Blocks:
 
 
Reported: 2014-03-27 07:32 UTC by Milan Crha
Modified: 2014-03-28 09:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
libedataserver: Make ECategories thread safe (13.46 KB, patch)
2014-03-27 23:11 UTC, Philip Withnall
committed Details | Review

Description Milan Crha 2014-03-27 07:32:20 UTC
This is a follow-up for bug #660535, with a request to make the e-categories.h API thread safe.
Comment 1 Philip Withnall 2014-03-27 23:11:58 UTC
Created attachment 273125 [details] [review]
libedataserver: Make ECategories thread safe

Previously it was not, and could potentially be used from multiple
threads simultaneously (e.g. the main UI thread, plus a contacts backend
thread).

Introduce a static global lock on the categories variables, which
prevents most race conditions. Two functions are inherently unsafe, due
to returning pointers to internal data structures. These functions have
been deprecated and replacements introduced.
Comment 2 Milan Crha 2014-03-28 07:32:30 UTC
Review of attachment 273125 [details] [review]:

Untested, but looks good. Just little nit-picks:
a) Use stable version reference, aka instead of 3.13.1 use 3.14.0 in the patch
b) (see below)

Please change that and commit to master. Thanks.

::: libedataserver/e-categories.c
@@ +567,3 @@
+ *
+ * Returns: (transfer full) (element-type utf8): a sorted #GList containing
+ * the names of the categories.The list should be freed using g_list_free(), and

Missing space before 'The'.
Comment 3 Philip Withnall 2014-03-28 08:54:56 UTC
Thanks for the fast review. Pushed with those changes. I'll file a new bug to port Evolution to use the new APIs.

Attachment 273125 [details] pushed as fe2f8f2 - libedataserver: Make ECategories thread safe
Comment 4 Philip Withnall 2014-03-28 09:19:07 UTC
(In reply to comment #3)
> I'll file a new bug to port Evolution to use the new APIs.

Bug #727221 filed with a patch.