+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
* Copyright (c) 2002-2014, International Business Machines Corporation
/**
* The mutex controlling access to SPECIAL_INVERSES
*/
-static UMutex LOCK = U_MUTEX_INITIALIZER;
+static UMutex *LOCK() {
+ static UMutex *m = STATIC_NEW(UMutex);
+ return m;
+}
TransliteratorIDParser::Specs::Specs(const UnicodeString& s, const UnicodeString& t,
const UnicodeString& v, UBool sawS,
bidirectional = FALSE;
}
- Mutex lock(&LOCK);
+ Mutex lock(LOCK());
UnicodeString *tempus = new UnicodeString(inverseTarget); // Used for null pointer check before usage.
if (tempus == NULL) {
UnicodeString* inverseTarget;
- umtx_lock(&LOCK);
+ umtx_lock(LOCK());
inverseTarget = (UnicodeString*) SPECIAL_INVERSES->get(specs.target);
- umtx_unlock(&LOCK);
+ umtx_unlock(LOCK());
if (inverseTarget != NULL) {
// If the original ID contained "Any-" then make the
/**
* Initialize static memory. Called through umtx_initOnce only.
*/
-void TransliteratorIDParser::init(UErrorCode &status) {
+void U_CALLCONV TransliteratorIDParser::init(UErrorCode &status) {
U_ASSERT(SPECIAL_INVERSES == NULL);
ucln_i18n_registerCleanup(UCLN_I18N_TRANSLITERATOR, utrans_transliterator_cleanup);