/*
******************************************************************************
*
-* Copyright (C) 1997-2006, International Business Machines
+* Copyright (C) 1997-2008, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
#if defined(U_DARWIN)
#include <AvailabilityMacros.h>
#if (ICU_USE_THREADS == 1) && defined(MAC_OS_X_VERSION_10_4) && defined(MAC_OS_X_VERSION_MIN_REQUIRED) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4)
+#if defined(__STRICT_ANSI__)
+#define UPRV_REMAP_INLINE
+#define inline
+#endif
#include <libkern/OSAtomic.h>
#define USE_MAC_OS_ATOMIC_INCREMENT 1
+#if defined(UPRV_REMAP_INLINE)
+#undef inline
+#undef UPRV_REMAP_INLINE
+#endif
#endif
#endif
*
*/
-#define MAX_MUTEXES 30
+#define MAX_MUTEXES 40
static UMTX gGlobalMutex = NULL;
static UMTX gIncDecMutex = NULL;
#if (ICU_USE_THREADS == 1)
}
gMutexPoolInitialized = TRUE;
}
+#elif defined (U_DARWIN)
+ /* PTHREAD_MUTEX_INITIALIZER works, don't need to call pthread_mutex_init
+ * as below (which is subject to a race condition)
+ */
+ gMutexPoolInitialized = TRUE;
#elif defined (POSIX)
/* TODO: experimental code. Shouldn't need to explicitly init the mutexes. */
if (gMutexPoolInitialized == FALSE) {