From 3797918d013db678b61d62956ed14ad50e7b70e1 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 27 Jun 2001 22:43:00 +0000 Subject: Initialize the private send_lock. (camel_transport_finalize): Free the 2001-06-27 Jeffrey Stedfast * camel-transport.c (camel_transport_init): Initialize the private send_lock. (camel_transport_finalize): Free the private send_lock. (camel_transport_get_type): Set the init and finalize functions. (camel_transport_send): Lock the transport. (camel_transport_send_to): Same. * camel-private.h: Add CAMEL_TRANSPORT_(UN)LOCK macros. svn path=/trunk/; revision=10547 --- camel/camel-private.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'camel/camel-private.h') diff --git a/camel/camel-private.h b/camel/camel-private.h index fa9b50a8a0..f63a452a4c 100644 --- a/camel/camel-private.h +++ b/camel/camel-private.h @@ -73,6 +73,20 @@ struct _CamelStorePrivate { #define CAMEL_STORE_UNLOCK(f, l) #endif +struct _CamelTransportPrivate { +#ifdef ENABLE_THREADS + GMutex *send_lock; /* for locking send operations */ +#endif +}; + +#ifdef ENABLE_THREADS +#define CAMEL_TRANSPORT_LOCK(f, l) (g_mutex_lock(((CamelTransport *)f)->priv->l)) +#define CAMEL_TRANSPORT_UNLOCK(f, l) (g_mutex_unlock(((CamelTransport *)f)->priv->l)) +#else +#define CAMEL_TRANSPORT_LOCK(f, l) +#define CAMEL_TRANSPORT_UNLOCK(f, l) +#endif + struct _CamelServicePrivate { #ifdef ENABLE_THREADS EMutex *connect_lock; /* for locking connection operations */ -- cgit v1.2.3