Skip to content

Commit e01ae39

Browse files
authored
[NFC][sanitizer] Use tid_t instead of int in ThreadLister (#111941)
1 parent 51e9430 commit e01ae39

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ ThreadLister::Result ThreadLister::ListThreads(
10861086
}
10871087
}
10881088

1089-
const char *ThreadLister::LoadStatus(int tid) {
1089+
const char *ThreadLister::LoadStatus(tid_t tid) {
10901090
auto cleanup = at_scope_exit([&] {
10911091
// Resize back to capacity if it is downsized by `ReadFileToVector`.
10921092
buffer_.resize(buffer_.capacity());
@@ -1097,7 +1097,7 @@ const char *ThreadLister::LoadStatus(int tid) {
10971097
return buffer_.data();
10981098
}
10991099

1100-
bool ThreadLister::IsAlive(int tid) {
1100+
bool ThreadLister::IsAlive(tid_t tid) {
11011101
// /proc/%d/task/%d/status uses same call to detect alive threads as
11021102
// proc_task_readdir. See task_state implementation in Linux.
11031103
static const char kPrefix[] = "\nPPid:";

compiler-rt/lib/sanitizer_common/sanitizer_linux.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ class ThreadLister {
103103
Ok,
104104
};
105105
Result ListThreads(InternalMmapVector<tid_t> *threads);
106-
const char *LoadStatus(int tid);
106+
const char *LoadStatus(tid_t tid);
107107

108108
private:
109-
bool IsAlive(int tid);
109+
bool IsAlive(tid_t tid);
110110

111111
InternalScopedString task_path_;
112112
InternalScopedString status_path_;

0 commit comments

Comments
 (0)