aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-04-10 11:02:33 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-04-10 11:02:33 +0800
commit35cd31644f6a1c44bfa54d12e199ec9e95edab6f (patch)
tree8b1e2dc87bdf5f7729579c57e84376263bc0deea
parent63a8a94536b64f931b64ac99e83de1f782cfcdf8 (diff)
downloadgsoc2013-evolution-35cd31644f6a1c44bfa54d12e199ec9e95edab6f.tar
gsoc2013-evolution-35cd31644f6a1c44bfa54d12e199ec9e95edab6f.tar.gz
gsoc2013-evolution-35cd31644f6a1c44bfa54d12e199ec9e95edab6f.tar.bz2
gsoc2013-evolution-35cd31644f6a1c44bfa54d12e199ec9e95edab6f.tar.lz
gsoc2013-evolution-35cd31644f6a1c44bfa54d12e199ec9e95edab6f.tar.xz
gsoc2013-evolution-35cd31644f6a1c44bfa54d12e199ec9e95edab6f.tar.zst
gsoc2013-evolution-35cd31644f6a1c44bfa54d12e199ec9e95edab6f.zip
Make the folder_lock recursive. See bug #22363 for details. Basically,
2002-04-09 Jeffrey Stedfast <fejj@ximian.com> * camel-store.c (camel_store_init): Make the folder_lock recursive. See bug #22363 for details. Basically, get_folder_info() is requesting a diary folder which in turn connects which requests then calls get_folder() but deadlocks because get_folder_info already holds the lock. svn path=/trunk/; revision=16419
-rw-r--r--camel/ChangeLog6
-rw-r--r--camel/camel-private.h8
-rw-r--r--camel/camel-store.c8
-rw-r--r--camel/camel-tcp-stream-ssl.c2
4 files changed, 16 insertions, 8 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 0fa9c03e0d..7d334da54a 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,11 @@
2002-04-09 Jeffrey Stedfast <fejj@ximian.com>
+ * camel-store.c (camel_store_init): Make the folder_lock
+ recursive. See bug #22363 for details. Basically,
+ get_folder_info() is requesting a diary folder which in turn
+ connects which requests then calls get_folder() but deadlocks
+ because get_folder_info already holds the lock.
+
* camel-mime-message.c (camel_mime_message_set_date): Don't adjust
the timezone offset if we used tm.tm_gmtoff because it is already
adjusted.
diff --git a/camel/camel-private.h b/camel/camel-private.h
index 78af7814b7..81cf2a4dad 100644
--- a/camel/camel-private.h
+++ b/camel/camel-private.h
@@ -59,16 +59,16 @@ struct _CamelFolderPrivate {
struct _CamelStorePrivate {
#ifdef ENABLE_THREADS
- GMutex *folder_lock; /* for locking folder operations */
- GMutex *cache_lock; /* for locking access to the cache */
+ EMutex *folder_lock; /* for locking folder operations */
+ EMutex *cache_lock; /* for locking access to the cache */
#else
gpointer dummy;
#endif
};
#ifdef ENABLE_THREADS
-#define CAMEL_STORE_LOCK(f, l) (g_mutex_lock(((CamelStore *)f)->priv->l))
-#define CAMEL_STORE_UNLOCK(f, l) (g_mutex_unlock(((CamelStore *)f)->priv->l))
+#define CAMEL_STORE_LOCK(f, l) (e_mutex_lock(((CamelStore *)f)->priv->l))
+#define CAMEL_STORE_UNLOCK(f, l) (e_mutex_unlock(((CamelStore *)f)->priv->l))
#else
#define CAMEL_STORE_LOCK(f, l)
#define CAMEL_STORE_UNLOCK(f, l)
diff --git a/camel/camel-store.c b/camel/camel-store.c
index 52126f3647..d230ef3777 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -129,8 +129,8 @@ camel_store_init (void *o)
store->priv = g_malloc0 (sizeof (*store->priv));
#ifdef ENABLE_THREADS
- store->priv->folder_lock = g_mutex_new ();
- store->priv->cache_lock = g_mutex_new ();
+ store->priv->folder_lock = e_mutex_new (E_MUTEX_REC);
+ store->priv->cache_lock = e_mutex_new (E_MUTEX_SIMPLE);
#endif
}
@@ -149,8 +149,8 @@ camel_store_finalize (CamelObject *object)
}
#ifdef ENABLE_THREADS
- g_mutex_free (store->priv->folder_lock);
- g_mutex_free (store->priv->cache_lock);
+ e_mutex_destroy (store->priv->folder_lock);
+ e_mutex_destroy (store->priv->cache_lock);
#endif
g_free (store->priv);
}
diff --git a/camel/camel-tcp-stream-ssl.c b/camel/camel-tcp-stream-ssl.c
index 29d9fd7bcc..a06fb93d1c 100644
--- a/camel/camel-tcp-stream-ssl.c
+++ b/camel/camel-tcp-stream-ssl.c
@@ -635,6 +635,8 @@ stream_connect (CamelTcpStream *stream, struct hostent *host, int port)
return -1;
}
+
+ errno = 0;
}
ssl->priv->sockfd = fd;