1 /****************************************************************************/
2 #if( defined _WIN32 && NTDDI_VERSION >= NTDDI_WINXP && !defined KERNEL_MODE )
4 /* TRD : Windows XP or better
6 _WIN32 indicates 64-bit or 32-bit Windows
7 NTDDI_VERSION indicates Windows version
8 - CreateMutex requires XP
9 - CloseHandle requires XP
10 - WaitForSingleObject requires XP
11 - ReleaseMutex requires XP
15 #define LIBBENCHMARK_PAL_LOCK_WINDOWS_MUTEX 1
17 #define LIBBENCHMARK_PAL_LOCK_WINDOWS_MUTEX_CREATE( pal_lock_windows_mutex_state ) pal_lock_windows_mutex_state = CreateMutex( NULL, FALSE, NULL )
18 #define LIBBENCHMARK_PAL_LOCK_WINDOWS_MUTEX_DESTROY( pal_lock_windows_mutex_state ) CloseHandle( pal_lock_windows_mutex_state )
19 #define LIBBENCHMARK_PAL_LOCK_WINDOWS_MUTEX_GET( pal_lock_windows_mutex_state ) WaitForSingleObject( pal_lock_windows_mutex_state, INFINITE )
20 #define LIBBENCHMARK_PAL_LOCK_WINDOWS_MUTEX_RELEASE( pal_lock_windows_mutex_state ) ReleaseMutex( pal_lock_windows_mutex_state )
22 /***** typedefs *****/
23 typedef HANDLE pal_lock_windows_mutex_state;
31 /****************************************************************************/
32 #if( !defined LIBBENCHMARK_PAL_LOCK_WINDOWS_MUTEX )
35 #define LIBBENCHMARK_PAL_LOCK_WINDOWS_MUTEX 0
37 #define LIBBENCHMARK_PAL_LOCK_WINDOWS_MUTEX_CREATE( pal_lock_windows_mutex_state )
38 #define LIBBENCHMARK_PAL_LOCK_WINDOWS_MUTEX_DESTROY( pal_lock_windows_mutex_state )
39 #define LIBBENCHMARK_PAL_LOCK_WINDOWS_MUTEX_GET( pal_lock_windows_mutex_state )
40 #define LIBBENCHMARK_PAL_LOCK_WINDOWS_MUTEX_RELEASE( pal_lock_windows_mutex_state )
42 /***** typedefs *****/
43 typedef void * pal_lock_windows_mutex_state;