Change in osmo-trx[master]: Threads: Avoid printing pthread_self()

laforge gerrit-no-reply at lists.osmocom.org
Mon Mar 1 19:38:08 UTC 2021


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

Change subject: Threads: Avoid printing pthread_self()
......................................................................

Threads: Avoid printing pthread_self()

 The type used to represent a thread ID is implementation
specific, and may be an opaqe structure, making it unsuitable to be
printed by standard means. Let's use osmo_gettid() instead.

Change-Id: Iaa4d0eaf52b901fff06cc67f8dd8b61ac6084911
Related: OS#5032
---
M CommonLibs/Threads.cpp
1 file changed, 2 insertions(+), 2 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 a98183a..b6750ab 100644
--- a/CommonLibs/Threads.cpp
+++ b/CommonLibs/Threads.cpp
@@ -49,7 +49,7 @@
 {
 	gStreamLock.lock();
 	Timeval entryTime;
-	cout << entryTime << " " << pthread_self() << ": ";
+	cout << entryTime << " " << osmo_gettid() << ": ";
 }
 
 
@@ -64,7 +64,7 @@
 {
 	gStreamLock.lock();
 	Timeval entryTime;
-	cerr << entryTime << " " << pthread_self() << ": ";
+	cerr << entryTime << " " << osmo_gettid() << ": ";
 }
 
 void unlockCerr()

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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: Iaa4d0eaf52b901fff06cc67f8dd8b61ac6084911
Gerrit-Change-Number: 23161
Gerrit-PatchSet: 2
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/20210301/d3fb3196/attachment.htm>


More information about the gerrit-log mailing list