21 #ifndef __TBB_machine_windows_api_H 22 #define __TBB_machine_windows_api_H 32 #else // Assume "usual" Windows 38 #if _WIN32_WINNT < 0x0600 41 #if !defined(WINBASEAPI) || (_WIN32_WINNT < 0x0501 && _MSC_VER == 1400) 42 #define __TBB_WINBASEAPI extern "C" 44 #define __TBB_WINBASEAPI WINBASEAPI 46 __TBB_WINBASEAPI BOOL WINAPI TryEnterCriticalSection( LPCRITICAL_SECTION );
47 __TBB_WINBASEAPI BOOL WINAPI InitializeCriticalSectionAndSpinCount( LPCRITICAL_SECTION, DWORD );
49 #define InitializeCriticalSectionEx inlineInitializeCriticalSectionEx 50 #define CreateSemaphoreEx inlineCreateSemaphoreEx 51 #define CreateEventEx inlineCreateEventEx 52 inline BOOL WINAPI inlineInitializeCriticalSectionEx( LPCRITICAL_SECTION lpCriticalSection, DWORD dwSpinCount, DWORD )
54 return InitializeCriticalSectionAndSpinCount( lpCriticalSection, dwSpinCount );
56 inline HANDLE WINAPI inlineCreateSemaphoreEx( LPSECURITY_ATTRIBUTES lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, LPCTSTR lpName, DWORD, DWORD )
58 return CreateSemaphore( lpSemaphoreAttributes, lInitialCount, lMaximumCount, lpName );
60 inline HANDLE WINAPI inlineCreateEventEx( LPSECURITY_ATTRIBUTES lpEventAttributes, LPCTSTR lpName, DWORD dwFlags, DWORD )
62 BOOL manual_reset = dwFlags&0x00000001 ? TRUE : FALSE;
63 BOOL initial_set = dwFlags&0x00000002 ? TRUE : FALSE;
64 return CreateEvent( lpEventAttributes, manual_reset, initial_set, lpName );
68 #if defined(RTL_SRWLOCK_INIT) 69 #ifndef __TBB_USE_SRWLOCK 71 #define __TBB_USE_SRWLOCK 0 76 #error tbb/machine/windows_api.h should only be used for Windows based platforms 77 #endif // _WIN32 || _WIN64 79 #endif // __TBB_machine_windows_api_H