[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-1101-g399c765

Jeremy Allison jra at samba.org
Mon Apr 20 11:00:41 GMT 2009


The branch, master has been updated
       via  399c765538d91c696efd1496fffd9ae1e876f3ae (commit)
      from  3d2e95c296a1858986b9c806dff67c9cc3d8f70d (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 399c765538d91c696efd1496fffd9ae1e876f3ae
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Apr 20 04:00:06 2009 -0700

    Attempt to fix build farm on platforms where pthread_once_t is a struct.
    Jeremy.

-----------------------------------------------------------------------

Summary of changes:
 lib/util/smb_threads.h  |    5 ++++-
 lib/util/talloc_stack.c |    4 ++--
 2 files changed, 6 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/smb_threads.h b/lib/util/smb_threads.h
index f4ed1fc..682e142 100644
--- a/lib/util/smb_threads.h
+++ b/lib/util/smb_threads.h
@@ -33,8 +33,11 @@
 
 #if defined(HAVE_PTHREAD_H)
 #define SMB_THREAD_ONCE_INIT PTHREAD_ONCE_INIT
+#define SMB_THREAD_ONCE_IS_INITIALIZED(val) (true)
+#define SMB_THREAD_ONCE_INITIALIZE(val)
 #else
-#define SMB_THREAD_ONCE_INIT false
+#define SMB_THREAD_ONCE_IS_INITIALIZED(val) ((val) == true)
+#define SMB_THREAD_ONCE_INITIALIZE(val) ((val) = true)
 #endif
 
 enum smb_thread_lock_type {
diff --git a/lib/util/talloc_stack.c b/lib/util/talloc_stack.c
index f5ca9d2..2ed18fa 100644
--- a/lib/util/talloc_stack.c
+++ b/lib/util/talloc_stack.c
@@ -62,10 +62,10 @@ static void talloc_stackframe_init(void)
 {
 	if (!global_tfp) {
 		/* Non-thread safe init case. */
-		if (ts_initialized) {
+		if (SMB_THREAD_ONCE_IS_INITIALIZED(ts_initialized)) {
 			return;
 		}
-		ts_initialized = true;
+		SMB_THREAD_ONCE_INITIALIZE(ts_initialized);
 	}
 
 	if (SMB_THREAD_CREATE_TLS("talloc_stackframe", global_ts)) {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list