You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/transitions/CApiTransitions.java
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -454,10 +454,22 @@ public static int pollReferenceQueue() {
454
454
if (handleContext.referenceQueuePollingState != RQ_READY) {
455
455
returnmanuallyCollected;
456
456
}
457
+
/*
458
+
* Polling the reference queue may deallocate native GC objects and therefore re-enter
459
+
* native code paths that use '_PyThreadState_GET()' to obtain the current thread's GC
460
+
* state. So, we may only poll once the current thread has installed its native
461
+
* 'tstate_current' pointer.
462
+
*/
463
+
if (!context.getThreadState(context.getLanguage()).isNativeThreadStateInitialized()) {
0 commit comments