diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-10-31 23:31:10 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2010-11-10 06:33:19 +0800 |
commit | eea1fa0fd06487bd58ffc2bcc936b9c8719934c0 (patch) | |
tree | ed55a7650c1beba687a043b67aebf5d33c3223b5 /modules/calendar | |
parent | 20651e4f0970fb49d522bd8c49949d84f116560a (diff) | |
download | gsoc2013-evolution-eea1fa0fd06487bd58ffc2bcc936b9c8719934c0.tar gsoc2013-evolution-eea1fa0fd06487bd58ffc2bcc936b9c8719934c0.tar.gz gsoc2013-evolution-eea1fa0fd06487bd58ffc2bcc936b9c8719934c0.tar.bz2 gsoc2013-evolution-eea1fa0fd06487bd58ffc2bcc936b9c8719934c0.tar.lz gsoc2013-evolution-eea1fa0fd06487bd58ffc2bcc936b9c8719934c0.tar.xz gsoc2013-evolution-eea1fa0fd06487bd58ffc2bcc936b9c8719934c0.tar.zst gsoc2013-evolution-eea1fa0fd06487bd58ffc2bcc936b9c8719934c0.zip |
Bug 628139 - Thread-safety issues in libical time zone loading
Diffstat (limited to 'modules/calendar')
-rw-r--r-- | modules/calendar/e-cal-shell-backend.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/modules/calendar/e-cal-shell-backend.c b/modules/calendar/e-cal-shell-backend.c index 134f706054..749dd7ec19 100644 --- a/modules/calendar/e-cal-shell-backend.c +++ b/modules/calendar/e-cal-shell-backend.c @@ -769,8 +769,34 @@ cal_shell_backend_class_init (ECalShellBackendClass *class) static void cal_shell_backend_init (ECalShellBackend *cal_shell_backend) { + icalarray *builtin_timezones; + gint ii; + cal_shell_backend->priv = E_CAL_SHELL_BACKEND_GET_PRIVATE (cal_shell_backend); + + /* XXX Pre-load all built-in timezones in libical. + * + * Built-in time zones in libical 0.43 are loaded on demand, + * but not in a thread-safe manner, resulting in a race when + * multiple threads call icaltimezone_load_builtin_timezone() + * on the same time zone. Until built-in time zone loading + * in libical is made thread-safe, work around the issue by + * loading all built-in time zones now, so libical's internal + * time zone array will be fully populated before any threads + * are spawned. + */ + builtin_timezones = icaltimezone_get_builtin_timezones (); + for (ii = 0; ii < builtin_timezones->num_elements; ii++) { + icaltimezone *zone; + + zone = icalarray_element_at (builtin_timezones, ii); + + /* We don't care about the component right now, + * we just need some function that will trigger + * icaltimezone_load_builtin_timezone(). */ + icaltimezone_get_component (zone); + } } GType |