Change in osmo-trx[master]: Threads.cpp: Use already existing gettid wrapper function

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Thu Feb 18 00:52:39 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/22948 )

Change subject: Threads.cpp: Use already existing gettid wrapper function
......................................................................

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
---
M CommonLibs/Threads.cpp
1 file changed, 1 insertion(+), 7 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



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 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 {

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/22948
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I2ccf94f95a531d5873da2a4681cf89cbc5b31422
Gerrit-Change-Number: 22948
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210218/4372bab4/attachment.htm>


More information about the gerrit-log mailing list