ICU-1872 Test for mutex initialization

X-SVN-Rev: 8505
This commit is contained in:
George Rhoten 2002-04-24 16:10:33 +00:00
parent d476d896a0
commit 53b969bd26

View File

@ -84,11 +84,15 @@ static pthread_mutex_t gPlatformMutex;
U_CAPI UBool U_EXPORT2 U_CAPI UBool U_EXPORT2
umtx_isInitialized(UMTX *mutex) umtx_isInitialized(UMTX *mutex)
{ {
#if (ICU_USE_THREADS == 1)
if (mutex == NULL) if (mutex == NULL)
{ {
mutex = &gGlobalMutex; mutex = &gGlobalMutex;
} }
return (UBool)(*mutex != NULL); 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 U_CAPI void U_EXPORT2