Skip to content

Commit daa322e

Browse files
committed
add assert that we own the gil when entering a python callee context
1 parent d82d641 commit daa322e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/ExecutionContext.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ public Node copy() {
217217
* Wrap the execution of a Python callee called from a Python frame.
218218
*/
219219
public void enter(VirtualFrame frame) {
220+
assert PythonLanguage.getContext().ownsGil() : PythonContext.dumpStackOnAssertionHelper("callee w/o GIL");
220221
// tfel: Create our frame reference here and store it so that
221222
// there's no reference to it from the caller side.
222223
PFrame.Reference thisFrameRef = new PFrame.Reference(PArguments.getCallerFrameInfo(frame));

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/PythonContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ void acquireGil() throws InterruptedException {
11661166
}
11671167
}
11681168

1169-
private static final String dumpStackOnAssertionHelper(String msg) {
1169+
static final String dumpStackOnAssertionHelper(String msg) {
11701170
Thread.dumpStack();
11711171
return msg;
11721172
}

0 commit comments

Comments
 (0)