From 87af511bac3acbf712b9045ec1783346fe312c9a Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sun, 2 Feb 2020 05:41:16 +0300 Subject: [PATCH] Rename function #7477 --- libs/libcommon/CMakeLists.txt | 4 ++-- libs/libcommon/include/common/getThreadNumber.h | 4 ---- libs/libcommon/src/getThreadNumber.cpp | 12 ------------ 3 files changed, 2 insertions(+), 18 deletions(-) delete mode 100644 libs/libcommon/include/common/getThreadNumber.h delete mode 100644 libs/libcommon/src/getThreadNumber.cpp diff --git a/libs/libcommon/CMakeLists.txt b/libs/libcommon/CMakeLists.txt index 2506d5adf2..765ab99bfe 100644 --- a/libs/libcommon/CMakeLists.txt +++ b/libs/libcommon/CMakeLists.txt @@ -17,7 +17,7 @@ set (COMMON_SRCS src/DateLUTImpl.cpp src/demangle.cpp src/getMemoryAmount.cpp - src/getThreadNumber.cpp + src/getThreadId.cpp src/JSON.cpp src/LineReader.cpp src/mremap.cpp @@ -36,7 +36,7 @@ set (COMMON_SRCS include/common/ErrorHandlers.h include/common/find_symbols.h include/common/getMemoryAmount.h - include/common/getThreadNumber.h + include/common/getThreadId.h include/common/JSON.h include/common/likely.h include/common/LineReader.h diff --git a/libs/libcommon/include/common/getThreadNumber.h b/libs/libcommon/include/common/getThreadNumber.h deleted file mode 100644 index 331d67d8b6..0000000000 --- a/libs/libcommon/include/common/getThreadNumber.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -/// Obtain thread id from OS. The value is cached in thread local variable. -unsigned getThreadNumber(); diff --git a/libs/libcommon/src/getThreadNumber.cpp b/libs/libcommon/src/getThreadNumber.cpp deleted file mode 100644 index c1d7c0ed4b..0000000000 --- a/libs/libcommon/src/getThreadNumber.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include -#include - - -static thread_local unsigned current_tid = 0; -unsigned getThreadNumber() -{ - if (!current_tid) - current_tid = syscall(SYS_gettid); /// This call is always successful. - man gettid - - return current_tid; -} -- GitLab