3 #ifndef __CDS_OS_WIN_THREAD_H
4 #define __CDS_OS_WIN_THREAD_H
8 namespace cds { namespace OS {
9 /// Windows-specific functions
10 CDS_CXX11_INLINE_NAMESPACE namespace Win32 {
12 /// OS-specific type of thread identifier
13 typedef DWORD ThreadId;
15 /// Get current thread id
16 static inline ThreadId getCurrentThreadId()
18 return ::GetCurrentThreadId();
21 /// Tests whether the thread is alive
22 static inline bool isThreadAlive( ThreadId id )
24 HANDLE h = ::OpenThread( SYNCHRONIZE, FALSE, id );
33 CDS_CONSTEXPR const Win32::ThreadId c_NullThreadId = 0;
35 #ifndef CDS_CXX11_INLINE_NAMESPACE_SUPPORT
36 using Win32::ThreadId;
37 using Win32::getCurrentThreadId;
38 using Win32::isThreadAlive;
42 }} // namespace cds::OS
44 #endif // #ifndef __CDS_OS_WIN_THREAD_H