1999-08-16 21:50:52 +00:00
|
|
|
/*
|
1999-12-09 23:27:55 +00:00
|
|
|
**********************************************************************
|
2002-07-25 15:25:44 +00:00
|
|
|
* Copyright (C) 1997-2002, International Business Machines
|
1999-12-09 23:27:55 +00:00
|
|
|
* Corporation and others. All Rights Reserved.
|
|
|
|
**********************************************************************
|
1999-08-16 21:50:52 +00:00
|
|
|
*/
|
|
|
|
|
2002-06-29 00:04:16 +00:00
|
|
|
#include "mutex.h"
|
2003-06-06 22:50:26 +00:00
|
|
|
#include "ucln_cmn.h"
|
1999-08-16 21:50:52 +00:00
|
|
|
|
2001-08-30 17:09:43 +00:00
|
|
|
/* Initialize the global mutex only when we can use it. */
|
|
|
|
#if (ICU_USE_THREADS == 1)
|
|
|
|
|
|
|
|
static int GlobalMutexInitialize()
|
1999-08-16 21:50:52 +00:00
|
|
|
{
|
2003-06-06 22:50:26 +00:00
|
|
|
UErrorCode status = U_ZERO_ERROR;
|
|
|
|
|
|
|
|
umtx_init(NULL);
|
|
|
|
ucnv_init(&status);
|
|
|
|
ures_init(&status);
|
|
|
|
return 0;
|
1999-08-16 21:50:52 +00:00
|
|
|
}
|
|
|
|
|
2001-08-30 17:09:43 +00:00
|
|
|
static int initializesGlobalMutex = GlobalMutexInitialize();
|
1999-08-16 21:50:52 +00:00
|
|
|
|
2001-08-30 17:09:43 +00:00
|
|
|
#endif /* ICU_USE_THREADS==1 */
|
2002-07-25 15:25:44 +00:00
|
|
|
|