aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2021-03-01 13:25:28 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2021-03-01 16:35:42 +0100
commit17ce7740e57a3f89b3ecedb68dafc4b595694af9 (patch)
tree73feb8b36257cc7800b87f5e4b1e953ce497d912
parentd06259f348ae54c1a66615d26a90fa1b1391874d (diff)
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
-rw-r--r--CommonLibs/Threads.cpp4
1 files changed, 2 insertions, 2 deletions
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 @@ void lockCout()
{
gStreamLock.lock();
Timeval entryTime;
- cout << entryTime << " " << pthread_self() << ": ";
+ cout << entryTime << " " << osmo_gettid() << ": ";
}
@@ -64,7 +64,7 @@ void lockCerr()
{
gStreamLock.lock();
Timeval entryTime;
- cerr << entryTime << " " << pthread_self() << ": ";
+ cerr << entryTime << " " << osmo_gettid() << ": ";
}
void unlockCerr()