scuffed-code/icu4c/source/common/mutex.cpp

28 lines
650 B
C++
Raw Normal View History

1999-08-16 21:50:52 +00:00
/*
**********************************************************************
* Copyright (C) 1997-2002, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
1999-08-16 21:50:52 +00:00
*/
#include "mutex.h"
#include "ucln_cmn.h"
1999-08-16 21:50:52 +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
{
UErrorCode status = U_ZERO_ERROR;
umtx_init(NULL);
ucnv_init(&status);
ures_init(&status);
return 0;
1999-08-16 21:50:52 +00:00
}
static int initializesGlobalMutex = GlobalMutexInitialize();
1999-08-16 21:50:52 +00:00
#endif /* ICU_USE_THREADS==1 */