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
This commit is contained in:
parent
ad202d72e1
commit
cec9eda227
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue