lvgl use recursive LOCK

This commit is contained in:
李昂 2024-02-19 23:56:06 +08:00
parent 043432f723
commit 9a5c80d802
2 changed files with 5 additions and 5 deletions

View File

@ -29,7 +29,7 @@
PikaObj* pika_lv_event_listener_g;
Args* pika_lv_id_register_g;
extern PikaEventListener* g_pika_lv_timer_event_listener;
pika_platform_thread_mutex_t pika_lv_global_mutex_g = {0};
pika_thread_recursive_mutex_t pika_lv_global_mutex_g = {0};
#if !PIKASCRIPT_VERSION_REQUIRE_MINIMUN(1, 13, 2)
#error "pikascript version must be greater than 1.13.2"
@ -59,7 +59,7 @@ void pika_lvgl_lock(PikaObj* self) {
if (!g_lvgl_inited) {
return;
}
pika_platform_thread_mutex_lock(&pika_lv_global_mutex_g);
pika_thread_recursive_mutex_lock(&pika_lv_global_mutex_g);
#else
return;
#endif
@ -70,7 +70,7 @@ void pika_lvgl_unlock(PikaObj* self) {
if (!g_lvgl_inited) {
return;
}
pika_platform_thread_mutex_unlock(&pika_lv_global_mutex_g);
pika_thread_recursive_mutex_unlock(&pika_lv_global_mutex_g);
#else
return;
#endif
@ -241,7 +241,7 @@ void pika_lvgl___init__(PikaObj* self) {
if (!g_lvgl_inited) {
#if PIKA_LVGL_THREAD_LOCK_ENABLE
pika_debug("Init pika_lv_global_mutex_g");
pika_platform_thread_mutex_init(&pika_lv_global_mutex_g);
pika_thread_recursive_mutex_init(&pika_lv_global_mutex_g);
#endif
pika_lvgl_lock(NULL);
lv_png_init();

View File

@ -803,7 +803,7 @@ PIKA_WEAK int pika_platform_thread_mutex_destroy(
WEAK_FUNCTION_NEED_OVERRIDE_ERROR(_);
return -1;
#endif
}
}
int pika_thread_recursive_mutex_init(pika_thread_recursive_mutex_t* m) {
int ret = pika_platform_thread_mutex_init(&m->mutex);