Used a static mutex to avoid the the simulataneous calls from calendar and
authorChenthill Palanisamy <pchenthill@novell.com>
Wed, 25 Aug 2004 12:54:36 +0000 (12:54 +0000)
committerChenthill Palanisamy <pchen@src.gnome.org>
Wed, 25 Aug 2004 12:54:36 +0000 (12:54 +0000)
2004-08-25  Chenthill Palanisamy <pchenthill@novell.com>

* 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.

calendar/ChangeLog
calendar/backends/groupwise/e-cal-backend-groupwise.c

index b027bc2..95675e1 100644 (file)
@@ -1,3 +1,10 @@
+2004-08-25  Chenthill Palanisamy <pchenthill@novell.com>
+
+       * 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 <snallagatla@novell.com>
 
        * backends/groupwise/e-cal-backend-groupwise.c 
index eb0ebff..1912b31 100644 (file)
@@ -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)
 {