Skip to content

Commit

Permalink
Call deregister thread tracer from ~Thread
Browse files Browse the repository at this point in the history
Added a missed call.
  • Loading branch information
shuhaowu committed Jul 18, 2024
1 parent fd78d5d commit f859259
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/cactus_rt/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class Thread {

// The constructors and destructors are needed because we need to delete
// objects of type Thread polymorphically, through the map in the App class.
virtual ~Thread() = default;
virtual ~Thread();

// Copy constructors are not allowed
Thread(const Thread&) = delete;
Expand Down
7 changes: 7 additions & 0 deletions src/cactus_rt/thread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,11 @@ void Thread::Start(int64_t start_monotonic_time_ns, App* app) {
int Thread::Join() const {
return pthread_join(thread_, nullptr);
}

Thread::~Thread() {
if (app_ != nullptr) {
app_->DeregisterThreadTracer(tracer_);
}
}

} // namespace cactus_rt

0 comments on commit f859259

Please sign in to comment.