mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-29 17:22:56 +08:00
rename vm_lock to GIL
This commit is contained in:
parent
b469aaa4ec
commit
6f659ca93d
@ -11,7 +11,7 @@ static void _thread_func(void* arg) {
|
|||||||
while (!_VM_is_first_lock()) {
|
while (!_VM_is_first_lock()) {
|
||||||
pika_platform_thread_delay();
|
pika_platform_thread_delay();
|
||||||
}
|
}
|
||||||
_VM_lock();
|
pika_GIL_lock();
|
||||||
PikaObj* ctx = New_PikaObj();
|
PikaObj* ctx = New_PikaObj();
|
||||||
pika_thread_info* info = (pika_thread_info*)arg;
|
pika_thread_info* info = (pika_thread_info*)arg;
|
||||||
obj_setArg(ctx, "args", info->args);
|
obj_setArg(ctx, "args", info->args);
|
||||||
@ -35,7 +35,7 @@ static void _thread_func(void* arg) {
|
|||||||
arg_deinit(info->args);
|
arg_deinit(info->args);
|
||||||
pika_platform_thread_destroy(info->thread);
|
pika_platform_thread_destroy(info->thread);
|
||||||
pikaFree(info, sizeof(pika_thread_info));
|
pikaFree(info, sizeof(pika_thread_info));
|
||||||
_VM_unlock();
|
pika_GIL_release();
|
||||||
}
|
}
|
||||||
|
|
||||||
void _thread_start_new_thread(PikaObj* self, Arg* function, Arg* args_) {
|
void _thread_start_new_thread(PikaObj* self, Arg* function, Arg* args_) {
|
||||||
|
@ -50,7 +50,7 @@ volatile VMSignal PikaVMSignal = {.signal_ctrl = VM_SIGNAL_CTRL_NONE,
|
|||||||
|
|
||||||
static pika_platform_thread_mutex_t pikavm_global_lock = {0};
|
static pika_platform_thread_mutex_t pikavm_global_lock = {0};
|
||||||
|
|
||||||
int _VM_lock(void) {
|
int pika_GIL_lock(void) {
|
||||||
if (!pikavm_global_lock.is_init) {
|
if (!pikavm_global_lock.is_init) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -61,7 +61,7 @@ int _VM_lock(void) {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _VM_unlock(void) {
|
int pika_GIL_release(void) {
|
||||||
if (!pikavm_global_lock.is_init) {
|
if (!pikavm_global_lock.is_init) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -3680,7 +3680,7 @@ void _pikaVM_yield(void) {
|
|||||||
#if PIKA_EVENT_ENABLE
|
#if PIKA_EVENT_ENABLE
|
||||||
_VMEvent_pickupEvent();
|
_VMEvent_pickupEvent();
|
||||||
#endif
|
#endif
|
||||||
_VM_unlock();
|
pika_GIL_release();
|
||||||
pika_platform_thread_delay();
|
pika_platform_thread_delay();
|
||||||
_VM_lock();
|
pika_GIL_lock();
|
||||||
}
|
}
|
||||||
|
@ -326,7 +326,7 @@ int _VMEvent_getVMCnt(void);
|
|||||||
void _VMEvent_pickupEvent(void);
|
void _VMEvent_pickupEvent(void);
|
||||||
void _pikaVM_yield(void);
|
void _pikaVM_yield(void);
|
||||||
int _VM_lock_init(void);
|
int _VM_lock_init(void);
|
||||||
int _VM_unlock(void);
|
int pika_GIL_release(void);
|
||||||
int _VM_lock(void);
|
int pika_GIL_lock(void);
|
||||||
int _VM_is_first_lock(void);
|
int _VM_is_first_lock(void);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user