Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(809)

Unified Diff: source/common/ucln_cmn.cpp

Issue 845603002: Update ICU to 54.1 step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@master
Patch Set: remove unusued directories Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/common/ucln_cmn.c ('k') | source/common/ucmndata.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/common/ucln_cmn.cpp
diff --git a/source/common/ucln_cmn.c b/source/common/ucln_cmn.cpp
similarity index 84%
rename from source/common/ucln_cmn.c
rename to source/common/ucln_cmn.cpp
index 0c04b0d7f910cf26a7aec4328bc24b9e1a8fa0bf..2480c9d3fd27e2514ed0a59168966033a74dedd8 100644
--- a/source/common/ucln_cmn.c
+++ b/source/common/ucln_cmn.cpp
@@ -1,9 +1,9 @@
/*
******************************************************************************
-* Copyright (C) 2001-2013, International Business Machines
+* Copyright (C) 2001-2014, International Business Machines
* Corporation and others. All Rights Reserved.
******************************************************************************
-* file name: ucln_cmn.c
+* file name: ucln_cmn.cpp
* encoding: US-ASCII
* tab size: 8 (not used)
* indentation:4
@@ -14,12 +14,13 @@
#include "unicode/utypes.h"
#include "unicode/uclean.h"
-#include "utracimp.h"
-#include "ucln_cmn.h"
-#include "cmutex.h"
-#include "ucln.h"
#include "cmemory.h"
+#include "mutex.h"
#include "uassert.h"
+#include "ucln.h"
+#include "ucln_cmn.h"
+#include "utracimp.h"
+#include "umutex.h"
/** Auto-client for UCLN_COMMON **/
#define UCLN_TYPE_IS_COMMON
@@ -65,6 +66,7 @@ ucln_common_registerCleanup(ECleanupCommonType type,
U_ASSERT(UCLN_COMMON_START < type && type < UCLN_COMMON_COUNT);
if (UCLN_COMMON_START < type && type < UCLN_COMMON_COUNT)
{
+ icu::Mutex m; // See ticket 10295 for discussion.
gCommonCleanupFunctions[type] = func;
}
#if !UCLN_NO_AUTO_CLEANUP && (defined(UCLN_AUTO_ATEXIT) || defined(UCLN_AUTO_LOCAL))
@@ -72,6 +74,10 @@ ucln_common_registerCleanup(ECleanupCommonType type,
#endif
}
+// Note: ucln_registerCleanup() is called with the ICU global mutex locked.
+// Be aware if adding anything to the function.
+// See ticket 10295 for discussion.
+
U_CAPI void U_EXPORT2
ucln_registerCleanup(ECleanupLibraryType type,
cleanupFunc *func)
@@ -84,11 +90,11 @@ ucln_registerCleanup(ECleanupLibraryType type,
}
U_CFUNC UBool ucln_lib_cleanup(void) {
- ECleanupLibraryType libType = UCLN_START;
- ECleanupCommonType commonFunc = UCLN_COMMON_START;
+ int32_t libType = UCLN_START;
+ int32_t commonFunc = UCLN_COMMON_START;
for (libType++; libType<UCLN_COMMON; libType++) {
- ucln_cleanupOne(libType);
+ ucln_cleanupOne(static_cast<ECleanupLibraryType>(libType));
}
for (commonFunc++; commonFunc<UCLN_COMMON_COUNT; commonFunc++) {
« no previous file with comments | « source/common/ucln_cmn.c ('k') | source/common/ucmndata.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698