Skip to content

Commit

Permalink
Fix Thread::getNativeId() on Cygwin
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed Oct 25, 2024
1 parent 68bcfb9 commit a102d0f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/swoole_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#include <sys/thread.h> /* thread_self() */
#elif defined(__NetBSD__)
#include <lwp.h> /* _lwp_self() */
#elif defined(__CYGWIN__) || defined(WIN32)
#include <windows.h> /* GetCurrentThreadId() */
#endif

static long swoole_thread_get_native_id(void) {
Expand All @@ -52,6 +54,8 @@ static long swoole_thread_get_native_id(void) {
#elif defined(__NetBSD__)
lwpid_t native_id;
native_id = _lwp_self();
#elif defined(__CYGWIN__) || defined(WIN32)
DWORD native_id = GetCurrentThreadId();
#endif
return native_id;
}

0 comments on commit a102d0f

Please sign in to comment.