We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 502b23e commit 6272957Copy full SHA for 6272957
graalpython/com.oracle.graal.python.cext/src/pystate.c
@@ -187,6 +187,13 @@ PyGILState_Release(PyGILState_STATE oldstate)
187
if (graalpy_gilstate_counter == 0 && graalpy_attached_thread) {
188
(*TRUFFLE_CONTEXT)->detachCurrentThread(TRUFFLE_CONTEXT);
189
graalpy_attached_thread = 0;
190
+#ifndef GRAALVM_PYTHON_LLVM_MANAGED
191
+ /*
192
+ * The thread state on the Java-side can get garbage collected after the thread is detached,
193
+ * so we need to make sure to fetch a fresh pointer the next time we attach.
194
+ */
195
+ tstate_current = NULL;
196
+#endif /* GRAALVM_PYTHON_LLVM_MANAGED */
197
}
198
199
0 commit comments