Skip to content

Commit

Permalink
[NFC][sanitizer] Use tid_t instead of int in ThreadLister (#111941)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalybuka authored Oct 11, 2024
1 parent 51e9430 commit e01ae39
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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:";
Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/lib/sanitizer_common/sanitizer_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand Down

0 comments on commit e01ae39

Please sign in to comment.