| Index: source/i18n/ucln_in.cpp
|
| diff --git a/source/i18n/ucln_in.c b/source/i18n/ucln_in.cpp
|
| similarity index 75%
|
| rename from source/i18n/ucln_in.c
|
| rename to source/i18n/ucln_in.cpp
|
| index cce5890d4527c6d65a5fe4fb50d29df9f89963e5..431d43161e760c860e7c0f9f32f8e1a938073086 100644
|
| --- a/source/i18n/ucln_in.c
|
| +++ b/source/i18n/ucln_in.cpp
|
| @@ -1,11 +1,11 @@
|
| /*
|
| ******************************************************************************
|
| * *
|
| -* Copyright (C) 2001-2009, International Business Machines *
|
| +* Copyright (C) 2001-2014, International Business Machines *
|
| * Corporation and others. All Rights Reserved. *
|
| * *
|
| ******************************************************************************
|
| -* file name: ucln_in.c
|
| +* file name: ucln_in.cpp
|
| * encoding: US-ASCII
|
| * tab size: 8 (not used)
|
| * indentation:4
|
| @@ -16,6 +16,7 @@
|
|
|
| #include "ucln.h"
|
| #include "ucln_in.h"
|
| +#include "mutex.h"
|
| #include "uassert.h"
|
|
|
| /** Auto-client for UCLN_I18N **/
|
| @@ -29,7 +30,8 @@ static cleanupFunc *gCleanupFunctions[UCLN_I18N_COUNT];
|
|
|
| static UBool i18n_cleanup(void)
|
| {
|
| - ECleanupI18NType libType = UCLN_I18N_START;
|
| + int32_t libType = UCLN_I18N_START;
|
| + (void)copyright; /* Suppress unused variable warning with clang. */
|
|
|
| while (++libType<UCLN_I18N_COUNT) {
|
| if (gCleanupFunctions[libType])
|
| @@ -45,13 +47,14 @@ static UBool i18n_cleanup(void)
|
| }
|
|
|
| void ucln_i18n_registerCleanup(ECleanupI18NType type,
|
| - cleanupFunc *func)
|
| -{
|
| + cleanupFunc *func) {
|
| U_ASSERT(UCLN_I18N_START < type && type < UCLN_I18N_COUNT);
|
| - ucln_registerCleanup(UCLN_I18N, i18n_cleanup);
|
| - if (UCLN_I18N_START < type && type < UCLN_I18N_COUNT)
|
| {
|
| - gCleanupFunctions[type] = func;
|
| + icu::Mutex m; // See ticket 10295 for discussion.
|
| + ucln_registerCleanup(UCLN_I18N, i18n_cleanup);
|
| + if (UCLN_I18N_START < type && type < UCLN_I18N_COUNT) {
|
| + gCleanupFunctions[type] = func;
|
| + }
|
| }
|
| #if !UCLN_NO_AUTO_CLEANUP && (defined(UCLN_AUTO_ATEXIT) || defined(UCLN_AUTO_LOCAL))
|
| ucln_registerAutomaticCleanup();
|
|
|