Commit 641294c 1 parent d22290f commit 641294c Copy full SHA for 641294c
File tree 2 files changed +15
-7
lines changed
2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -939,13 +939,6 @@ class ThreadTable {
939
939
if (thread.state == Thread::State::RUNNING) {
940
940
thread.pthread_id = pthread_self ();
941
941
thread.native_tid = get_native_thread_id ();
942
- if (thread.name == " " ) {
943
- // rb_inspect should be safe here, as RUNNING should correspond to RESUMED hook from internal_thread_event_cb
944
- // which is called with GVL per https://github.com/ruby/ruby/blob/v3_3_0/include/ruby/thread.h#L247-L248
945
- VALUE thread_str = rb_inspect (th);
946
- if (RTEST (thread_str))
947
- thread.name = StringValueCStr (thread_str);
948
- }
949
942
} else {
950
943
thread.pthread_id = 0 ;
951
944
thread.native_tid = 0 ;
Original file line number Diff line number Diff line change @@ -148,6 +148,21 @@ def test_raised_exceptions_will_output
148
148
assert File . exist? ( output_file )
149
149
end
150
150
151
+ class ThreadWithInspect < ::Thread
152
+ def inspect
153
+ raise "boom!"
154
+ end
155
+ end
156
+
157
+ def test_thread_with_inspect
158
+ result = Vernier . trace do
159
+ th1 = ThreadWithInspect . new { sleep 0.01 }
160
+ th1 . join
161
+ end
162
+
163
+ assert_valid_result result
164
+ end
165
+
151
166
def assert_similar expected , actual
152
167
delta_ratio =
153
168
if SLOW_RUNNER
You can’t perform that action at this time.
0 commit comments