diff --git a/icu4c/source/common/mutex.cpp b/icu4c/source/common/mutex.cpp index b2937e819f..fa2dbd0066 100644 --- a/icu4c/source/common/mutex.cpp +++ b/icu4c/source/common/mutex.cpp @@ -11,6 +11,13 @@ /* 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; diff --git a/icu4c/source/common/ucln_cmn.c b/icu4c/source/common/ucln_cmn.c index 388b4a86d0..e74f3015fc 100644 --- a/icu4c/source/common/ucln_cmn.c +++ b/icu4c/source/common/ucln_cmn.c @@ -102,7 +102,12 @@ u_cleanup(void) U_CAPI void U_EXPORT2 u_init(UErrorCode *status) { - /* Make sure the global mutex is initialized. */ + /* Make sure the global mutexes are initialized. */ + /* + * NOTE: This section of code replicates functionality from GlobalMutexInitialize() + * in the file mutex.cpp. Any changes must be made in both places. + * TODO: combine them. + */ umtx_init(NULL); ucnv_init(status); ures_init(status);