[evolution-mapi] Bug #608766 - Replace pthread with GLib's GThread



commit f8f909f78f5da413761e3a70f567273421cb97f6
Author: Milan Crha <mcrha redhat com>
Date:   Thu Apr 15 14:48:04 2010 +0200

    Bug #608766 - Replace pthread with GLib's GThread

 po/Makefile.in.in             |    4 ++--
 src/camel/camel-mapi-folder.c |    3 +--
 src/camel/camel-private.h     |    8 +++-----
 3 files changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
index cc8a222..c7e8302 100644
--- a/po/Makefile.in.in
+++ b/po/Makefile.in.in
@@ -56,7 +56,7 @@ ALL_LINGUAS = @ALL_LINGUAS@
 
 PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi)
 
-USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep \^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep \^$$lang$$`"; then printf "$$lang "; fi; done; fi)
+USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep '^$$lang$$' $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep '^$$lang$$'`"; then printf "$$lang "; fi; done; fi)
 
 USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
 
@@ -129,7 +129,7 @@ install-data-yes: all
 	done
 
 # Empty stubs to satisfy archaic automake needs
-dvi info ctags tags CTAGS TAGS ID:
+dvi info tags TAGS ID:
 
 # Define this as empty until I found a useful application.
 install-exec installcheck:
diff --git a/src/camel/camel-mapi-folder.c b/src/camel/camel-mapi-folder.c
index efb8bd5..42409d6 100644
--- a/src/camel/camel-mapi-folder.c
+++ b/src/camel/camel-mapi-folder.c
@@ -25,7 +25,6 @@
 #include <config.h>
 #endif
 
-#include <pthread.h>
 #include <string.h>
 #include <time.h>
 
@@ -46,7 +45,7 @@
 #include "camel-mapi-summary.h"
 #include "camel-mapi-utils.h"
 
-#define DEBUG_FN( ) printf("----%u %s\n", (unsigned int)pthread_self(), __FUNCTION__);
+#define DEBUG_FN( ) printf("----%p %s\n", g_thread_self(), G_STRFUNC);
 #define SUMMARY_FETCH_BATCH_COUNT 150
 #define d(x)
 
diff --git a/src/camel/camel-private.h b/src/camel/camel-private.h
index 7d4f960..bde187e 100644
--- a/src/camel/camel-private.h
+++ b/src/camel/camel-private.h
@@ -31,8 +31,6 @@
 #include "config.h"
 #endif
 
-#include <pthread.h>
-
 G_BEGIN_DECLS
 
 struct _CamelFolderPrivate {
@@ -144,11 +142,11 @@ struct _CamelVeeFolderPrivate {
 #define CAMEL_VEE_FOLDER_UNLOCK(f, l) (g_mutex_unlock(((CamelVeeFolder *)f)->priv->l))
 
 struct _CamelDataWrapperPrivate {
-	pthread_mutex_t stream_lock;
+	GStaticMutex stream_lock;
 };
 
-#define CAMEL_DATA_WRAPPER_LOCK(dw, l)   (pthread_mutex_lock(&((CamelDataWrapper *)dw)->priv->l))
-#define CAMEL_DATA_WRAPPER_UNLOCK(dw, l) (pthread_mutex_unlock(&((CamelDataWrapper *)dw)->priv->l))
+#define CAMEL_DATA_WRAPPER_LOCK(dw, l)   (g_static_mutex_lock(&((CamelDataWrapper *)dw)->priv->l))
+#define CAMEL_DATA_WRAPPER_UNLOCK(dw, l) (g_static_mutex_unlock(&((CamelDataWrapper *)dw)->priv->l))
 
 /* most of this stuff really is private, but the lock can be used by subordinate classes */
 struct _CamelCertDBPrivate {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]