aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-text-index.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-text-index.c
parent16ce509ec02a99acf7324c4e157cf1cf781a8a67 (diff)
downloadgsoc2013-evolution-2bd47d3cda52acc0beb688ffb4a8202412de5c09.tar.gz
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-text-index.c')
-rw-r--r--camel/camel-text-index.c31
1 files changed, 9 insertions, 22 deletions
diff --git a/camel/camel-text-index.c b/camel/camel-text-index.c
index 3682a6633e..fd10a5ce5f 100644
--- a/camel/camel-text-index.c
+++ b/camel/camel-text-index.c
@@ -1,6 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*- */
/*
- * Copyright (C) 2001 Ximian Inc.
+ * Copyright (C) 2001-2003 Ximian Inc.
*
* Authors: Michael Zucchi <notzed@ximian.com>
*
@@ -23,17 +23,16 @@
#include <config.h>
#endif
-#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
#include <sys/stat.h>
#include <sys/uio.h>
#include <unistd.h>
#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
+#include <ctype.h>
#include "e-util/e-msgport.h"
#include "e-util/e-memory.h"
@@ -46,7 +45,6 @@
#include <glib/gunicode.h>
-#include <stdio.h>
#define w(x)
#define io(x)
@@ -55,13 +53,8 @@
/* cursor debug */
#define c(x)
-#ifdef ENABLE_THREADS
#define CAMEL_TEXT_INDEX_LOCK(kf, lock) (e_mutex_lock(((CamelTextIndex *)kf)->priv->lock))
#define CAMEL_TEXT_INDEX_UNLOCK(kf, lock) (e_mutex_unlock(((CamelTextIndex *)kf)->priv->lock))
-#else
-#define CAMEL_TEXT_INDEX_LOCK(kf, lock)
-#define CAMEL_TEXT_INDEX_UNLOCK(kf, lock)
-#endif
static int text_index_compress_nosync(CamelIndex *idx);
@@ -130,9 +123,7 @@ struct _CamelTextIndexPrivate {
int word_cache_count;
EDList word_cache;
GHashTable *words;
-#ifdef ENABLE_THREADS
EMutex *lock;
-#endif
};
/* Root block of text index */
@@ -766,10 +757,8 @@ camel_text_index_init(CamelTextIndex *idx)
/* this cache size and the block cache size have been tuned for about the best
with moderate memory usage. Doubling the memory usage barely affects performance. */
p->word_cache_limit = 4096; /* 1024 = 128K */
-
-#ifdef ENABLE_THREADS
+
p->lock = e_mutex_new(E_MUTEX_REC);
-#endif
}
static void
@@ -797,11 +786,9 @@ camel_text_index_finalise(CamelTextIndex *idx)
camel_object_unref((CamelObject *)p->blocks);
if (p->links)
camel_object_unref((CamelObject *)p->links);
-
-#ifdef ENABLE_THREADS
+
e_mutex_destroy(p->lock);
-#endif
-
+
g_free(p);
}