ICU-4497 use UMTX_CHECK()
X-SVN-Rev: 17580
This commit is contained in:
parent
587dde47b3
commit
e030002e3e
@ -276,9 +276,8 @@ static UBool _load() {
|
||||
* to load it, and return TRUE if the load succeeds.
|
||||
*/
|
||||
static inline UBool load() {
|
||||
umtx_lock(NULL);
|
||||
UBool f = (PNAME!=NULL);
|
||||
umtx_unlock(NULL);
|
||||
UBool f;
|
||||
UMTX_CHECK(NULL, (PNAME!=NULL), f);
|
||||
return f || _load();
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
******************************************************************************
|
||||
*
|
||||
* Copyright (C) 1999-2004, International Business Machines
|
||||
* Copyright (C) 1999-2005, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
******************************************************************************
|
||||
@ -121,9 +121,7 @@ isDataLoaded(UErrorCode *pErrorCode) {
|
||||
UBool isCached;
|
||||
|
||||
/* do this because double-checked locking is broken */
|
||||
umtx_lock(NULL);
|
||||
isCached=uCharNames!=NULL;
|
||||
umtx_unlock(NULL);
|
||||
UMTX_CHECK(NULL, (uCharNames!=NULL), isCached);
|
||||
|
||||
if(!isCached) {
|
||||
UCharNames *names;
|
||||
|
Loading…
Reference in New Issue
Block a user