From cec9eda227487ee2f5947e9ed5135fbe9578e013 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Wed, 17 Feb 2021 17:27:53 +0100 Subject: Threads.cpp: Use already existing gettid wrapper function A wrapper function with better support already exists in debug.c and announced in debug.h. Let's use that one instead. Related: OS#5027 Change-Id: I2ccf94f95a531d5873da2a4681cf89cbc5b31422 --- CommonLibs/Threads.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/CommonLibs/Threads.cpp b/CommonLibs/Threads.cpp index 020d94e..d8dab57 100644 --- a/CommonLibs/Threads.cpp +++ b/CommonLibs/Threads.cpp @@ -32,12 +32,6 @@ #include "Timeval.h" #include "Logger.h" -#ifndef gettid -#include -#define gettid() syscall(SYS_gettid) -#endif - - using namespace std; #ifndef HAVE_ATOMIC_OPS @@ -114,7 +108,7 @@ void Signal::wait(Mutex& wMutex, unsigned timeout) const void set_selfthread_name(const char *name) { pthread_t selfid = pthread_self(); - pid_t tid = gettid(); + pid_t tid = my_gettid(); if (pthread_setname_np(selfid, name) == 0) { LOG(INFO) << "Thread "<< selfid << " (task " << tid << ") set name: " << name; } else { -- cgit v1.2.3