Skip to content

Commit

Permalink
Update pthread_create_gotcha.cpp
Browse files Browse the repository at this point in the history
- make sure hash for "start_thread" exists on main thread
  • Loading branch information
jrmadsen committed Oct 16, 2023
1 parent 914cd53 commit 4771355
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "library/sampling.hpp"
#include "library/thread_data.hpp"
#include "library/thread_info.hpp"
#include "library/tracing.hpp"

#include <timemory/backends/threading.hpp>
#include <timemory/components/macros.hpp>
Expand Down Expand Up @@ -367,6 +368,8 @@ pthread_create_gotcha::configure()
0, int, pthread_t*, const pthread_attr_t*, void* (*) (void*), void*>(
"pthread_create");
};

tim::hash::add_hash_id("start_thread");
}

void
Expand All @@ -387,6 +390,8 @@ pthread_create_gotcha::shutdown()
if(itr.second) ++_ndangling;
}

tracing::copy_timemory_hash_ids();

// enable the signal handler for when the timeout is reached
struct sigaction _action = {};
struct sigaction _former = {};
Expand Down

0 comments on commit 4771355

Please sign in to comment.