aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2021-02-17 17:27:53 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2021-02-17 17:28:06 +0100
commitcec9eda227487ee2f5947e9ed5135fbe9578e013 (patch)
treee1ef62570bdcba18e7fc14b518d476c177900b11
parentad202d72e11970ebb74686a7755e0e1ce635496f (diff)
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
-rw-r--r--CommonLibs/Threads.cpp8
1 files changed, 1 insertions, 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 <sys/syscall.h>
-#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 {