From edcd035130c5924d284dff1e8915b776be6dd586 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Fri, 2 Feb 2024 14:39:29 +0800 Subject: [PATCH] sys.cpp: update pthread_threadid code for macOS --- src/occa/internal/utils/sys.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git src/occa/internal/utils/sys.cpp src/occa/internal/utils/sys.cpp index dbaf3212..46273aec 100644 --- src/occa/internal/utils/sys.cpp +++ src/occa/internal/utils/sys.cpp @@ -402,12 +402,13 @@ namespace occa { int getTID() { #if (OCCA_OS & (OCCA_LINUX_OS | OCCA_MACOS_OS)) -#if OCCA_OS == OCCA_MACOS_OS & (MAC_OS_X_VERSION_MAX_ALLOWED >= 101200) +#if OCCA_OS == OCCA_MACOS_OS & (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070) uint64_t tid64; - pthread_threadid_np(NULL, &tid64); + pthread_threadid_np(nullptr, &tid64); pid_t tid = (pid_t)tid64; #else - pid_t tid = syscall(SYS_gettid); + uint64_t tid; + tid = pthread_mach_thread_np(pthread_self()); #endif return tid; #else