Skip to content

Commit 8d35484

Browse files
committed
Fix test and instrumentation_tools
1 parent da2270b commit 8d35484

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

Lib/test/test_free_threading/test_monitoring.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ def test_register_callback(self):
219219
self.assertEqual(ref(), None)
220220

221221
def test_set_local_trace_opcodes(self):
222-
return
223222
def trace(frame, event, arg):
224223
frame.f_trace_opcodes = True
225224
return trace
@@ -233,7 +232,7 @@ def f():
233232
with l:
234233
pass
235234

236-
t = threading.Thread(target=f)
235+
t = Thread(target=f)
237236
t.start()
238237
for i in range(3000):
239238
with l:

Python/instrumentation.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ instrumentation_cross_checks(PyInterpreterState *interp, PyCodeObject *code)
10001000
return monitors_equals(code->_co_monitoring->active_monitors, expected);
10011001
}
10021002

1003-
static inline
1003+
static
10041004
int debug_check_sanity(PyInterpreterState *interp, PyCodeObject *code)
10051005
{
10061006
int res;
@@ -1688,11 +1688,8 @@ update_instrumentation_data(PyCodeObject *code, PyInterpreterState *interp)
16881688
PyErr_NoMemory();
16891689
return -1;
16901690
}
1691-
// Initialize all of the instructions so if local events change while another thread is executing
1692-
// we know what the original opcode was.
16931691
for (int i = 0; i < code_len; i++) {
1694-
int opcode = _PyCode_CODE(code)[i].op.code;
1695-
code->_co_monitoring->per_instruction_tools[i] = _PyOpcode_Deopt[opcode];
1692+
code->_co_monitoring->per_instruction_tools[i] = 0;
16961693
}
16971694
}
16981695
}

0 commit comments

Comments
 (0)