mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-15 09:45:26 +00:00
ICU-1872 Test for mutex initialization
X-SVN-Rev: 8505
This commit is contained in:
parent
d476d896a0
commit
53b969bd26
1 changed files with 4 additions and 0 deletions
|
@ -84,11 +84,15 @@ static pthread_mutex_t gPlatformMutex;
|
|||
U_CAPI UBool U_EXPORT2
|
||||
umtx_isInitialized(UMTX *mutex)
|
||||
{
|
||||
#if (ICU_USE_THREADS == 1)
|
||||
if (mutex == NULL)
|
||||
{
|
||||
mutex = &gGlobalMutex;
|
||||
}
|
||||
return (UBool)(*mutex != NULL);
|
||||
#else
|
||||
return TRUE; /* Since we don't use threads, it's considered initialized. */
|
||||
#endif /* ICU_USE_THREADS==1 */
|
||||
}
|
||||
|
||||
U_CAPI void U_EXPORT2
|
||||
|
|
Loading…
Add table
Reference in a new issue