| Index: source/io/ucln_io.cpp
|
| diff --git a/source/io/ucln_io.c b/source/io/ucln_io.cpp
|
| similarity index 77%
|
| rename from source/io/ucln_io.c
|
| rename to source/io/ucln_io.cpp
|
| index 041f4e737efbc41cb6d85b6400e5b0ed3065b0ff..1775d5c509435370e087daaaacb466ec19c36949 100644
|
| --- a/source/io/ucln_io.c
|
| +++ b/source/io/ucln_io.cpp
|
| @@ -1,11 +1,11 @@
|
| /*
|
| ******************************************************************************
|
| * *
|
| -* Copyright (C) 2001-2013, International Business Machines *
|
| +* Copyright (C) 2001-2014, International Business Machines *
|
| * Corporation and others. All Rights Reserved. *
|
| * *
|
| ******************************************************************************
|
| -* file name: ucln_io.c
|
| +* file name: ucln_io.cpp
|
| * encoding: US-ASCII
|
| * tab size: 8 (not used)
|
| * indentation:4
|
| @@ -14,6 +14,7 @@
|
| * created by: George Rhoten
|
| */
|
|
|
| +#include "mutex.h"
|
| #include "ucln.h"
|
| #include "ucln_io.h"
|
| #include "uassert.h"
|
| @@ -34,8 +35,9 @@ static cleanupFunc *gCleanupFunctions[UCLN_IO_COUNT];
|
|
|
| static UBool io_cleanup(void)
|
| {
|
| - ECleanupIOType libType = UCLN_IO_START;
|
| + int32_t libType = UCLN_IO_START;
|
|
|
| + (void)copyright; // Suppress unused variable warning.
|
| while (++libType<UCLN_IO_COUNT) {
|
| if (gCleanupFunctions[libType])
|
| {
|
| @@ -50,13 +52,14 @@ static UBool io_cleanup(void)
|
| }
|
|
|
| void ucln_io_registerCleanup(ECleanupIOType type,
|
| - cleanupFunc *func)
|
| -{
|
| + cleanupFunc *func) {
|
| U_ASSERT(UCLN_IO_START < type && type < UCLN_IO_COUNT);
|
| - ucln_registerCleanup(UCLN_IO, io_cleanup);
|
| - if (UCLN_IO_START < type && type < UCLN_IO_COUNT)
|
| {
|
| - gCleanupFunctions[type] = func;
|
| + icu::Mutex m; // See ticket 10295 for discussion.
|
| + ucln_registerCleanup(UCLN_IO, io_cleanup);
|
| + if (UCLN_IO_START < type && type < UCLN_IO_COUNT) {
|
| + gCleanupFunctions[type] = func;
|
| + }
|
| }
|
|
|
| #if !UCLN_NO_AUTO_CLEANUP && (defined(UCLN_AUTO_ATEXIT) || defined(UCLN_AUTO_LOCAL))
|
|
|