+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/**
*******************************************************************************
* Copyright (C) 2001-2012, International Business Machines Corporation and *
EventListener::~EventListener() {}
UOBJECT_DEFINE_RTTI_IMPLEMENTATION(EventListener)
-static UMutex notifyLock = U_MUTEX_INITIALIZER;
+static UMutex *notifyLock() {
+ static UMutex *m = STATIC_NEW(UMutex);
+ return m;
+}
ICUNotifier::ICUNotifier(void)
: listeners(NULL)
ICUNotifier::~ICUNotifier(void) {
{
- Mutex lmx(¬ifyLock);
+ Mutex lmx(notifyLock());
delete listeners;
listeners = NULL;
}
}
if (acceptsListener(*l)) {
- Mutex lmx(¬ifyLock);
+ Mutex lmx(notifyLock());
if (listeners == NULL) {
listeners = new UVector(5, status);
} else {
}
{
- Mutex lmx(¬ifyLock);
+ Mutex lmx(notifyLock());
if (listeners != NULL) {
// identity equality check
for (int i = 0, e = listeners->size(); i < e; ++i) {
ICUNotifier::notifyChanged(void)
{
if (listeners != NULL) {
- Mutex lmx(¬ifyLock);
+ Mutex lmx(notifyLock());
if (listeners != NULL) {
for (int i = 0, e = listeners->size(); i < e; ++i) {
EventListener* el = (EventListener*)listeners->elementAt(i);