DOSBox-X
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
src/hardware/snd_pc98/sound/sndcsec.h
00001 
00002 #if !defined(SOUND_CRITICAL)
00003 
00004 #define SNDCSEC_INIT
00005 #define SNDCSEC_TERM
00006 #define SNDCSEC_ENTER
00007 #define SNDCSEC_LEAVE
00008 
00009 #else
00010 
00011 #ifdef __cplusplus
00012 extern "C" {
00013 #endif
00014 
00015 #if defined(WIN32) || defined(_WIN32_WCE)
00016 
00017 extern  CRITICAL_SECTION        sndcsec;
00018 
00019 #define SNDCSEC_INIT    InitializeCriticalSection(&sndcsec)
00020 #define SNDCSEC_TERM    DeleteCriticalSection(&sndcsec)
00021 #define SNDCSEC_ENTER   EnterCriticalSection(&sndcsec)
00022 #define SNDCSEC_LEAVE   LeaveCriticalSection(&sndcsec)
00023 
00024 #elif defined(MACOS)
00025 
00026 extern  MPCriticalRegionID      sndcsec;
00027 
00028 #define SNDCSEC_INIT    MPCreateCriticalRegion(&sndcsec)
00029 #define SNDCSEC_TERM    MPDeleteCriticalRegion(sndcsec)
00030 #define SNDCSEC_ENTER   MPEnterCriticalRegion(sndcsec, kDurationForever)
00031 #define SNDCSEC_LEAVE   MPExitCriticalRegion(sndcsec)
00032 
00033 #elif defined(X11) || defined(SLZAURUS)
00034 
00035 extern  pthread_mutex_t         sndcsec;
00036 
00037 #define SNDCSEC_INIT    pthread_mutex_init(&sndcsec, NULL)
00038 #define SNDCSEC_TERM    pthread_mutex_destroy(&sndcsec)
00039 #define SNDCSEC_ENTER   pthread_mutex_lock(&sndcsec)
00040 #define SNDCSEC_LEAVE   pthread_mutex_unlock(&sndcsec)
00041 
00042 #endif
00043 
00044 #ifdef __cplusplus
00045 }
00046 #endif
00047 
00048 #endif
00049