--- parser3/src/main/pa_threads.C 2020/12/15 17:10:37 1.7 +++ parser3/src/main/pa_threads.C 2026/10/29 11:50:58 1.13 @@ -1,13 +1,13 @@ /** @file Parser: simple Mutex realization class. - Copyright (c) 2001-2020 Art. Lebedev Studio (http://www.artlebedev.com) - Author: Alexandr Petrosian (http://paf.design.ru) + Copyright (c) 2001-2026 Art. Lebedev Studio (https://www.artlebedev.com) + Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_threads.h" -volatile const char * IDENT_PA_THREADS_C="$Id: pa_threads.C,v 1.7 2020/12/15 17:10:37 moko Exp $" IDENT_PA_THREADS_H; +volatile const char * IDENT_PA_THREADS_C="$Id: pa_threads.C,v 1.13 2026/10/29 11:50:58 moko Exp $" IDENT_PA_THREADS_H; Mutex global_mutex; @@ -39,12 +39,19 @@ void Mutex::release() { #ifdef HAVE_GETTID #include #endif +#ifdef HAVE_THR_SELF +#include +#endif uint pa_get_thread_id() { -#ifdef HAVE_GETTID +#if defined(HAVE_GETTID) return syscall(__NR_gettid); +#elif defined(HAVE_THR_SELF) + long id; + thr_self(&id); + return id; #else - return 1; + return getpid(); #endif }