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
This commit is contained in:
committed by
Jeffrey Stedfast
parent
63a8a94536
commit
35cd31644f
@ -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.
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -635,6 +635,8 @@ stream_connect (CamelTcpStream *stream, struct hostent *host, int port)
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
}
|
||||
|
||||
ssl->priv->sockfd = fd;
|
||||
|
||||
Reference in New Issue
Block a user