+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
* Copyright (C) 2008-2013, International Business Machines Corporation and
#include "uhash.h"
static UHashtable* gGenderInfoCache = NULL;
-static UMutex gGenderMetaLock = U_MUTEX_INITIALIZER;
+
static const char* gNeutralStr = "neutral";
static const char* gMailTaintsStr = "maleTaints";
static const char* gMixedNeutralStr = "mixedNeutral";
return NULL;
}
+ static UMutex *gGenderMetaLock = STATIC_NEW(UMutex);
const GenderInfo* result = NULL;
const char* key = locale.getName();
{
- Mutex lock(&gGenderMetaLock);
+ Mutex lock(gGenderMetaLock);
result = (const GenderInfo*) uhash_get(gGenderInfoCache, key);
}
if (result) {
// Try to put our GenderInfo object in cache. If there is a race condition,
// favor the GenderInfo object that is already in the cache.
{
- Mutex lock(&gGenderMetaLock);
+ Mutex lock(gGenderMetaLock);
GenderInfo* temp = (GenderInfo*) uhash_get(gGenderInfoCache, key);
if (temp) {
result = temp;