ICU-1872 Make the error into an warning.

X-SVN-Rev: 8687
This commit is contained in:
George Rhoten 2002-05-23 23:52:37 +00:00
parent f64672ff36
commit 90d29f462f

View File

@ -52,11 +52,13 @@ static UBool gMutexInitialized = FALSE;
static void TestMutex(void) {
if (!gMutexInitialized) {
log_err("*** Failure! The global mutex was not initialized.\n"
log_verbose("*** Failure! The global mutex was not initialized.\n"
"*** Make sure the right linker was used.\n");
}
}
void addSetup(TestNode** root);
void addSetup(TestNode** root)
{
addTest(root, &TestMutex, "setup/TestMutex");
@ -157,6 +159,19 @@ int main(int argc, const char* const argv[])
#endif
}
if (!gMutexInitialized) {
fprintf(stderr,
"#### WARNING!\n"
" The global mutex was not initialized during C++ static initialization.\n"
" You must use an ICU API in a single thread, like ucnv_open() or\n"
" uloc_countAvailable(), before using ICU in multiple threads.\n"
" Most ICU API functions will initialize the global mutex for you.\n"
" If you are using ICU in a single threaded application, please ignore this\n"
" warning.\n"
"#### WARNING!\n"
);
}
return nerrors ? 1 : 0;
}