File tree Expand file tree Collapse file tree 1 file changed +23
-4
lines changed
include/boost/interprocess/detail Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Original file line number Diff line number Diff line change 6363#elif defined(__APPLE__)
6464 #include < pthread.h>
6565#elif defined(__NetBSD__)
66- #include < lwp.h>
66+ #include < lwp.h>
6767#elif defined(__OpenBSD__)
68- #include < unistd.h>
68+ #include < unistd.h>
6969#elif defined(__sun) && defined(__SVR4)
70- #include < thread.h>
70+ #include < thread.h>
71+ #elif defined(__CYGWIN__)
72+ #ifndef __LP64__ // 32 bit target
73+ typedef unsigned long BOOSTIPC_CYGWIN_DWORD;
74+ #else // 64 bit Cygwin target
75+ typedef unsigned int BOOSTIPC_CYGWIN_DWORD;
76+ #endif
77+ extern " C" {
78+ __declspec (dllimport) BOOSTIPC_CYGWIN_DWORD __stdcall GetCurrentThreadId (void );
79+ } // extern "C" {
7180#endif
7281
7382
@@ -349,7 +358,17 @@ inline OS_systemwide_thread_id_t get_current_systemwide_thread_id()
349358inline OS_systemwide_thread_id_t get_invalid_systemwide_thread_id ()
350359{ return (thread_t )(-1 ); }
351360
352- #else // fallback to fragile pthread-based solution
361+ #elif defined(__CYGWIN__)
362+
363+ typedef BOOSTIPC_CYGWIN_DWORD OS_systemwide_thread_id_t;
364+
365+ inline OS_systemwide_thread_id_t get_current_systemwide_thread_id ()
366+ { return ::GetCurrentThreadId (); }
367+
368+ inline OS_systemwide_thread_id_t get_invalid_systemwide_thread_id ()
369+ { return (OS_systemwide_thread_id_t)(-1 ); }
370+
371+ #else // fallback to fragile nad mostly wrong pthread-based solution
353372
354373class OS_systemwide_thread_id_t
355374{
You can’t perform that action at this time.
0 commit comments