evolution-data-server r8398 - in trunk/calendar: . backends/caldav



Author: mcrha
Date: Mon Jan 21 12:02:17 2008
New Revision: 8398
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=8398&view=rev

Log:
2008-01-21  Milan Crha  <mcrha redhat com>

	** Fix for bug #510168

	* backends/caldav/e-cal-backend-caldav.c: (synch_slave_loop),
	(struct _ECalBackendCalDAVPrivate), (e_cal_backend_caldav_dispose),
	(e_cal_backend_caldav_finalize), (e_cal_backend_caldav_init):
	Ensure slave gone in dispose function of the backend.



Modified:
   trunk/calendar/ChangeLog
   trunk/calendar/backends/caldav/e-cal-backend-caldav.c

Modified: trunk/calendar/backends/caldav/e-cal-backend-caldav.c
==============================================================================
--- trunk/calendar/backends/caldav/e-cal-backend-caldav.c	(original)
+++ trunk/calendar/backends/caldav/e-cal-backend-caldav.c	Mon Jan 21 12:02:17 2008
@@ -81,6 +81,9 @@
 	/* cond to synch threads */
 	GCond *cond;
 
+	/* cond to know the slave gone */
+	GCond *slave_gone_cond;
+
 	/* BG synch thread */
 	GThread *synch_slave;
 	SlaveCommand slave_cmd;
@@ -1364,6 +1367,9 @@
 
 	}
 
+	/* signal we are done */
+	g_cond_signal (priv->slave_gone_cond);
+
 	/* we got killed ... */
 	g_mutex_unlock (priv->lock);
 	return NULL;
@@ -2537,10 +2543,9 @@
 	/* stop the slave  */
 	priv->slave_cmd = SLAVE_SHOULD_DIE;
 	g_cond_signal (priv->cond);
-	g_mutex_unlock (priv->lock);
 
 	/* wait until the slave died */
-	g_mutex_lock (priv->lock);
+	g_cond_wait (priv->slave_gone_cond, priv->lock);
 
 	g_object_unref (priv->session);
 
@@ -2570,6 +2575,7 @@
 
 	g_mutex_free (priv->lock);
 	g_cond_free (priv->cond);
+	g_cond_free (priv->slave_gone_cond);
 
 	if (G_OBJECT_CLASS (parent_class)->finalize)
 		(* G_OBJECT_CLASS (parent_class)->finalize) (object);
@@ -2591,8 +2597,9 @@
 	priv->do_synch = FALSE;
 	priv->loaded   = FALSE;
 
-	priv->cond = g_cond_new ();
 	priv->lock = g_mutex_new ();
+	priv->cond = g_cond_new ();
+	priv->slave_gone_cond = g_cond_new ();
 
 	/* Slave control ... */
 	priv->slave_cmd = SLAVE_SHOULD_SLEEP;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]