Skip to content

Commit

Permalink
Don't unset thread.pthread_id
Browse files Browse the repository at this point in the history
We might get started events on Ruby 3.3 while another thread is still
running.
  • Loading branch information
jhawthorn committed Dec 9, 2023
1 parent 639ffa0 commit 312072d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions ext/vernier/vernier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -932,9 +932,6 @@ class ThreadTable {
//fprintf(stderr, "th %p (tid: %i) from %s to %s\n", (void *)th, native_tid, gvl_event_name(state), gvl_event_name(new_state));

for (auto &thread : list) {
if (thread.pthread_id == pthread_id) {
thread.pthread_id = 0;
}
if (thread_equal(th, thread.ruby_thread)) {
if (new_state == Thread::State::SUSPENDED) {

Expand Down Expand Up @@ -1234,9 +1231,7 @@ class GlobalSignalHandler {
void record_sample(LiveSample &sample, pthread_t pthread_id) {
const std::lock_guard<std::mutex> lock(mutex);

if (!pthread_id) {
abort();
}
assert(pthread_id);

live_sample = &sample;
if (pthread_kill(pthread_id, SIGPROF)) {
Expand Down

0 comments on commit 312072d

Please sign in to comment.