ICU-11131 re-checking in due to conflicts with r36481..

X-SVN-Rev: 36483
This commit is contained in:
Steven R. Loomis 2014-09-11 22:47:47 +00:00
parent 174485b702
commit 482e90080c

View File

@ -58,6 +58,7 @@
#include "uassert.h"
#include "cmemory.h"
#include "umutex.h"
#include "mutex.h"
#include <float.h>
#include "smpdtfst.h"
@ -1072,7 +1073,9 @@ SimpleDateFormat::initNumberFormatters(const Locale &locale,UErrorCode &status)
if ( fDateOverride.isBogus() && fTimeOverride.isBogus() ) {
return;
}
umtx_lock(&LOCK);
{
UMutex lock(&LOCK);
if (fNumberFormatters == NULL) {
fNumberFormatters = (NumberFormat**)uprv_malloc(UDAT_FIELD_COUNT * sizeof(NumberFormat*));
if (fNumberFormatters) {
@ -1083,7 +1086,8 @@ SimpleDateFormat::initNumberFormatters(const Locale &locale,UErrorCode &status)
status = U_MEMORY_ALLOCATION_ERROR;
}
}
umtx_unlock(&LOCK);
// exit mutex
}
if (U_FAILURE(status)) {
return;