mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
update _time for GIL
This commit is contained in:
parent
524d83af16
commit
0d27c99cdc
@ -12,12 +12,14 @@ void (*global_do_sleep_ms)(uint32_t);
|
||||
static void _do_sleep_ms_tick(uint32_t ms) {
|
||||
uint32_t tick = pika_platform_get_tick();
|
||||
while (pika_platform_get_tick() - tick < ms) {
|
||||
_pikaVM_yield();
|
||||
_VMEvent_pickupEvent();
|
||||
}
|
||||
}
|
||||
|
||||
void _time_sleep_ms(PikaObj* self, int ms) {
|
||||
pika_GIL_EXIT();
|
||||
global_do_sleep_ms(ms);
|
||||
pika_GIL_ENTER();
|
||||
}
|
||||
|
||||
void _time_sleep_s(PikaObj* self, int s) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user