From: Chenthill Palanisamy Date: Wed, 25 Aug 2004 12:54:36 +0000 (+0000) Subject: Used a static mutex to avoid the the simulataneous calls from calendar and X-Git-Tag: upstream/3.7.4~8424 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c58feaeb7ddc9a7cb33f88d2861777d873c98c86;p=platform%2Fupstream%2Fevolution-data-server.git Used a static mutex to avoid the the simulataneous calls from calendar and 2004-08-25 Chenthill Palanisamy * backends/groupwise/e-cal-backend-groupwise.c (populate_cache): Used a static mutex to avoid the the simulataneous calls from calendar and tasks to ReadCursorRequest which crashes the server. --- diff --git a/calendar/ChangeLog b/calendar/ChangeLog index b027bc2..95675e1 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,10 @@ +2004-08-25 Chenthill Palanisamy + + * backends/groupwise/e-cal-backend-groupwise.c + (populate_cache): Used a static mutex to avoid the + the simulataneous calls from calendar and tasks to + ReadCursorRequest which crashes the server. + 2004-08-24 Sivaiah Nallagatla * backends/groupwise/e-cal-backend-groupwise.c diff --git a/calendar/backends/groupwise/e-cal-backend-groupwise.c b/calendar/backends/groupwise/e-cal-backend-groupwise.c index eb0ebff..1912b31 100644 --- a/calendar/backends/groupwise/e-cal-backend-groupwise.c +++ b/calendar/backends/groupwise/e-cal-backend-groupwise.c @@ -102,6 +102,8 @@ e_cal_backend_groupwise_get_default_zone (ECalBackendGroupwise *cbgw) { return cbgw->priv->default_zone; } +static GMutex *mutex = NULL; + /* Initialy populate the cache from the server */ static EGwConnectionStatus populate_cache (ECalBackendGroupwise *cbgw) @@ -114,6 +116,12 @@ populate_cache (ECalBackendGroupwise *cbgw) int cursor = 0; priv = cbgw->priv; + + if (!mutex) { + mutex = g_mutex_new (); + } + + g_mutex_lock (mutex); /* get the list of category ids and corresponding names from the server */ status = e_gw_connection_get_categories (priv->cnc, priv->categories_by_id, priv->categories_by_name); @@ -154,6 +162,8 @@ populate_cache (ECalBackendGroupwise *cbgw) } e_gw_connection_destroy_cursor (priv->cnc, priv->container_id, cursor); + g_mutex_unlock (mutex); + return E_GW_CONNECTION_STATUS_OK; } @@ -247,6 +257,8 @@ form_uri (ESource *source) } + + static ECalBackendSyncStatus connect_to_server (ECalBackendGroupwise *cbgw) {