[compiler-rt] e01ae39 - [NFC][sanitizer] Use tid_t instead of int in ThreadLister (#111941)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 10 20:56:28 PDT 2024
Author: Vitaly Buka
Date: 2024-10-10T20:56:25-07:00
New Revision: e01ae3920dd98779f2e58aa8f103ae3b6c6b5499
URL: https://github.com/llvm/llvm-project/commit/e01ae3920dd98779f2e58aa8f103ae3b6c6b5499
DIFF: https://github.com/llvm/llvm-project/commit/e01ae3920dd98779f2e58aa8f103ae3b6c6b5499.diff
LOG: [NFC][sanitizer] Use tid_t instead of int in ThreadLister (#111941)
Added:
Modified:
compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
compiler-rt/lib/sanitizer_common/sanitizer_linux.h
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
index a4e58133c79f08..31750cf65ab6eb 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
@@ -1086,7 +1086,7 @@ ThreadLister::Result ThreadLister::ListThreads(
}
}
-const char *ThreadLister::LoadStatus(int tid) {
+const char *ThreadLister::LoadStatus(tid_t tid) {
auto cleanup = at_scope_exit([&] {
// Resize back to capacity if it is downsized by `ReadFileToVector`.
buffer_.resize(buffer_.capacity());
@@ -1097,7 +1097,7 @@ const char *ThreadLister::LoadStatus(int tid) {
return buffer_.data();
}
-bool ThreadLister::IsAlive(int tid) {
+bool ThreadLister::IsAlive(tid_t tid) {
// /proc/%d/task/%d/status uses same call to detect alive threads as
// proc_task_readdir. See task_state implementation in Linux.
static const char kPrefix[] = "\nPPid:";
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.h b/compiler-rt/lib/sanitizer_common/sanitizer_linux.h
index 07d9528813b3fe..8b7874bb5a3494 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.h
@@ -103,10 +103,10 @@ class ThreadLister {
Ok,
};
Result ListThreads(InternalMmapVector<tid_t> *threads);
- const char *LoadStatus(int tid);
+ const char *LoadStatus(tid_t tid);
private:
- bool IsAlive(int tid);
+ bool IsAlive(tid_t tid);
InternalScopedString task_path_;
InternalScopedString status_path_;
More information about the llvm-commits
mailing list