aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap/camel-imap-private.h
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-01-24 04:34:50 +0800
committerDan Winship <danw@src.gnome.org>2001-01-24 04:34:50 +0800
commit5d7f815b3eede63ce843c7de7a3d2302c6b93586 (patch)
tree2ff2b1789ad7455a4aaf14304323efd8194ca387 /camel/providers/imap/camel-imap-private.h
parent4028f454b6c274fa093056180af8d11e5c7bfd1e (diff)
downloadgsoc2013-evolution-5d7f815b3eede63ce843c7de7a3d2302c6b93586.tar
gsoc2013-evolution-5d7f815b3eede63ce843c7de7a3d2302c6b93586.tar.gz
gsoc2013-evolution-5d7f815b3eede63ce843c7de7a3d2302c6b93586.tar.bz2
gsoc2013-evolution-5d7f815b3eede63ce843c7de7a3d2302c6b93586.tar.lz
gsoc2013-evolution-5d7f815b3eede63ce843c7de7a3d2302c6b93586.tar.xz
gsoc2013-evolution-5d7f815b3eede63ce843c7de7a3d2302c6b93586.tar.zst
gsoc2013-evolution-5d7f815b3eede63ce843c7de7a3d2302c6b93586.zip
Add a lock around the delayed loading, so two threads won't try to do it
* providers/imap/camel-imap-wrapper.c: Add a lock around the delayed loading, so two threads won't try to do it at the same time. svn path=/trunk/; revision=7752
Diffstat (limited to 'camel/providers/imap/camel-imap-private.h')
-rw-r--r--camel/providers/imap/camel-imap-private.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/camel/providers/imap/camel-imap-private.h b/camel/providers/imap/camel-imap-private.h
index abcb3f8dd7..c7af3ee5e6 100644
--- a/camel/providers/imap/camel-imap-private.h
+++ b/camel/providers/imap/camel-imap-private.h
@@ -66,6 +66,20 @@ struct _CamelImapFolderPrivate {
#define CAMEL_IMAP_FOLDER_UNLOCK(f, l)
#endif
+struct _CamelImapWrapperPrivate {
+#ifdef ENABLE_THREADS
+ GMutex *lock;
+#endif
+};
+
+#ifdef ENABLE_THREADS
+#define CAMEL_IMAP_WRAPPER_LOCK(f, l) (g_mutex_lock(((CamelImapWrapper *)f)->priv->l))
+#define CAMEL_IMAP_WRAPPER_UNLOCK(f, l) (g_mutex_unlock(((CamelImapWrapper *)f)->priv->l))
+#else
+#define CAMEL_IMAP_WRAPPER_LOCK(f, l)
+#define CAMEL_IMAP_WRAPPER_UNLOCK(f, l)
+#endif
+
#ifdef __cplusplus
}
#endif /* __cplusplus */