ICU-4497 use UMTX_CHECK()

X-SVN-Rev: 17580
This commit is contained in:
Markus Scherer 2005-05-10 21:08:58 +00:00
parent 587dde47b3
commit e030002e3e
2 changed files with 4 additions and 7 deletions

View File

@ -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();
}

View File

@ -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;