aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-partition-table.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-07-10 03:05:13 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-07-10 03:05:13 +0800
commit2bd47d3cda52acc0beb688ffb4a8202412de5c09 (patch)
tree66b1a9f93e8b5bfdeb8c9350bda05f98d3e7eeca /camel/camel-partition-table.c
parent16ce509ec02a99acf7324c4e157cf1cf781a8a67 (diff)
downloadgsoc2013-evolution-2bd47d3cda52acc0beb688ffb4a8202412de5c09.tar
gsoc2013-evolution-2bd47d3cda52acc0beb688ffb4a8202412de5c09.tar.gz
gsoc2013-evolution-2bd47d3cda52acc0beb688ffb4a8202412de5c09.tar.bz2
gsoc2013-evolution-2bd47d3cda52acc0beb688ffb4a8202412de5c09.tar.lz
gsoc2013-evolution-2bd47d3cda52acc0beb688ffb4a8202412de5c09.tar.xz
gsoc2013-evolution-2bd47d3cda52acc0beb688ffb4a8202412de5c09.tar.zst
gsoc2013-evolution-2bd47d3cda52acc0beb688ffb4a8202412de5c09.zip
Get rid of the #ifdef ENABLE_THREADS since we no longer plan to
2003-07-09 Jeffrey Stedfast <fejj@ximian.com> * camel-block-file.c: Get rid of the #ifdef ENABLE_THREADS since we no longer plan to support/maintain this. * camel.c: Same. * camel-certdb.c: Here too. * camel-charset-map.c: And here. * camel-cipher-context.c: " * camel-data-wrapper.c: " * camel-digest-folder.c: " * camel-exception.c: " * camel-folder.c: " * camel-folder-summary.c: " * camel-lock-client.c: " * camel-mime-utils.c: " * camel-object.c: " * camel-operation.c: " * camel-partition-table.c: " * camel-sasl-popb4smtp.c: " * camel-service.c: " * camel-session.c: " * camel-store.c: " * camel-store-summary.c: " * camel-text-index.c: " * camel-transport.c: " * camel-vee-folder.c: " * camel-tcp-stream-openssl.c: Removed pthread.h, it isn't needed. svn path=/trunk/; revision=21777
Diffstat (limited to 'camel/camel-partition-table.c')
-rw-r--r--camel/camel-partition-table.c45
1 files changed, 13 insertions, 32 deletions
diff --git a/camel/camel-partition-table.c b/camel/camel-partition-table.c
index fad1a5e002..e5b2639a4a 100644
--- a/camel/camel-partition-table.c
+++ b/camel/camel-partition-table.c
@@ -1,5 +1,6 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
- * Copyright (C) 2001 Ximian Inc.
+ * Copyright (C) 2001-2003 Ximian Inc.
*
* Authors: Michael Zucchi <notzed@ximian.com>
*
@@ -18,20 +19,19 @@
* Boston, MA 02111-1307, USA.
*/
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#include <sys/stat.h>
-#include <sys/uio.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
#include <stdlib.h>
-
+#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/uio.h>
+#include <unistd.h>
#include <fcntl.h>
+#include <errno.h>
#include "e-util/e-msgport.h"
@@ -42,15 +42,10 @@
tables consistent after program crash without sync */
/*#define SYNC_UPDATES*/
-#ifdef ENABLE_THREADS
-#include <pthread.h>
-#endif
-
#define d(x) /*(printf("%s(%d):%s: ", __FILE__, __LINE__, __PRETTY_FUNCTION__),(x))*/
/* key index debug */
#define k(x) /*(printf("%s(%d):%s: ", __FILE__, __LINE__, __PRETTY_FUNCTION__),(x))*/
-#ifdef ENABLE_THREADS
struct _CamelPartitionTablePrivate {
pthread_mutex_t lock; /* for locking partition */
@@ -58,10 +53,7 @@ struct _CamelPartitionTablePrivate {
#define CAMEL_PARTITION_TABLE_LOCK(kf, lock) (pthread_mutex_lock(&(kf)->priv->lock))
#define CAMEL_PARTITION_TABLE_UNLOCK(kf, lock) (pthread_mutex_unlock(&(kf)->priv->lock))
-#else
-#define CAMEL_PARTITION_TABLE_LOCK(kf, lock)
-#define CAMEL_PARTITION_TABLE_UNLOCK(kf, lock)
-#endif
+
static void
camel_partition_table_class_init(CamelPartitionTableClass *klass)
@@ -76,9 +68,7 @@ camel_partition_table_init(CamelPartitionTable *cpi)
e_dlist_init(&cpi->partition);
p = cpi->priv = g_malloc0(sizeof(*cpi->priv));
-#ifdef ENABLE_THREADS
pthread_mutex_init(&p->lock, NULL);
-#endif
}
static void
@@ -98,10 +88,9 @@ camel_partition_table_finalise(CamelPartitionTable *cpi)
camel_object_unref((CamelObject *)cpi->blocks);
}
-
-#ifdef ENABLE_THREADS
+
pthread_mutex_destroy(&p->lock);
-#endif
+
g_free(p);
}
@@ -606,18 +595,13 @@ fail:
/* ********************************************************************** */
-#ifdef ENABLE_THREADS
-
struct _CamelKeyTablePrivate {
pthread_mutex_t lock; /* for locking key */
};
#define CAMEL_KEY_TABLE_LOCK(kf, lock) (pthread_mutex_lock(&(kf)->priv->lock))
#define CAMEL_KEY_TABLE_UNLOCK(kf, lock) (pthread_mutex_unlock(&(kf)->priv->lock))
-#else
-#define CAMEL_KEY_TABLE_LOCK(kf, lock)
-#define CAMEL_KEY_TABLE_UNLOCK(kf, lock)
-#endif
+
static void
camel_key_table_class_init(CamelKeyTableClass *klass)
@@ -630,9 +614,7 @@ camel_key_table_init(CamelKeyTable *ki)
struct _CamelKeyTablePrivate *p;
p = ki->priv = g_malloc0(sizeof(*ki->priv));
-#ifdef ENABLE_THREADS
pthread_mutex_init(&p->lock, NULL);
-#endif
}
static void
@@ -650,10 +632,9 @@ camel_key_table_finalise(CamelKeyTable *ki)
camel_block_file_sync(ki->blocks);
camel_object_unref((CamelObject *)ki->blocks);
}
-
-#ifdef ENABLE_THREADS
+
pthread_mutex_destroy(&p->lock);
-#endif
+
g_free(p);
}