mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-14 01:11:02 +00:00
ICU-11131 revert to r36481
X-SVN-Rev: 36484
This commit is contained in:
parent
482e90080c
commit
11462b188e
1 changed files with 7 additions and 11 deletions
|
@ -58,7 +58,6 @@
|
|||
#include "uassert.h"
|
||||
#include "cmemory.h"
|
||||
#include "umutex.h"
|
||||
#include "mutex.h"
|
||||
#include <float.h>
|
||||
#include "smpdtfst.h"
|
||||
|
||||
|
@ -1073,21 +1072,18 @@ SimpleDateFormat::initNumberFormatters(const Locale &locale,UErrorCode &status)
|
|||
if ( fDateOverride.isBogus() && fTimeOverride.isBogus() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
UMutex lock(&LOCK);
|
||||
if (fNumberFormatters == NULL) {
|
||||
umtx_lock(&LOCK);
|
||||
if (fNumberFormatters == NULL) {
|
||||
fNumberFormatters = (NumberFormat**)uprv_malloc(UDAT_FIELD_COUNT * sizeof(NumberFormat*));
|
||||
if (fNumberFormatters) {
|
||||
for (int32_t i = 0; i < UDAT_FIELD_COUNT; i++) {
|
||||
fNumberFormatters[i] = fNumberFormat;
|
||||
}
|
||||
for (int32_t i = 0; i < UDAT_FIELD_COUNT; i++) {
|
||||
fNumberFormatters[i] = fNumberFormat;
|
||||
}
|
||||
} else {
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
}
|
||||
}
|
||||
// exit mutex
|
||||
}
|
||||
umtx_unlock(&LOCK);
|
||||
|
||||
if (U_FAILURE(status)) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Reference in a new issue