X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/b75a7d8f3b4adbae880cab104ce2c6a50eee4db2..7393aa2fd2c40c89f12c2db881842a563afdb429:/icuSources/common/mutex.cpp diff --git a/icuSources/common/mutex.cpp b/icuSources/common/mutex.cpp index fa2dbd00..b54a847b 100644 --- a/icuSources/common/mutex.cpp +++ b/icuSources/common/mutex.cpp @@ -1,34 +1,18 @@ -/* - ********************************************************************** - * Copyright (C) 1997-2002, International Business Machines - * Corporation and others. All Rights Reserved. - ********************************************************************** +/** +******************************************************************************* +* Copyright (C) 2008, International Business Machines Corporation. * +* All Rights Reserved. * +******************************************************************************* */ -#include "mutex.h" -#include "ucln_cmn.h" - -/* Initialize the global mutex only when we can use it. */ -#if (ICU_USE_THREADS == 1) - -/* - * NOTE: This function replicates functionality from the start - * u_init(). Any changes must be made in both places. - * TODO: combine them. - * - * This function runs only during C++ static initialization. - */ -static int GlobalMutexInitialize() -{ - UErrorCode status = U_ZERO_ERROR; +#include "unicode/utypes.h" - umtx_init(NULL); - ucnv_init(&status); - ures_init(&status); - return 0; -} +#if UCONFIG_NO_SERVICE -static int initializesGlobalMutex = GlobalMutexInitialize(); - -#endif /* ICU_USE_THREADS==1 */ +/* If UCONFIG_NO_SERVICE, then there is no invocation of Mutex elsewhere in + common, so add one here to force an export */ +#include "mutex.h" +static Mutex *aMutex = 0; +/* UCONFIG_NO_SERVICE */ +#endif