support GIL_ENTER when vm_cnt goto 0

This commit is contained in:
lyon1998 2024-05-03 00:02:31 +08:00
parent 16f55887c3
commit 4e99de0b4c
2 changed files with 4 additions and 6 deletions

View File

@ -3006,11 +3006,9 @@ PIKA_RES _do_pika_eventListener_send(PikaEventListener* self,
/* using multi thread */
if (pika_GIL_isInit()) {
/* python thread is running */
if (g_PikaVMState.vm_cnt != 0) {
/* wait python thread get first lock */
while (!_VM_is_first_lock()) {
pika_platform_thread_yield();
}
/* wait python thread get first lock */
while (!_VM_is_first_lock() && g_PikaVMState.vm_cnt != 0) {
pika_platform_thread_yield();
}
pika_GIL_ENTER();
#if PIKA_EVENT_THREAD_ENABLE

View File

@ -2,4 +2,4 @@
#define PIKA_VERSION_MINOR 13
#define PIKA_VERSION_MICRO 3
#define PIKA_EDIT_TIME "2024/05/02 23:58:57"
#define PIKA_EDIT_TIME "2024/05/03 00:02:22"