ensure the event has been processed 28/300728/1
authorJoonbum Ko <joonbum.ko@samsung.com>
Wed, 1 Nov 2023 08:50:56 +0000 (17:50 +0900)
committerJoonbum Ko <joonbum.ko@samsung.com>
Wed, 1 Nov 2023 08:50:56 +0000 (17:50 +0900)
Change-Id: Icb164faa38c574328ecd38c82933771edfafa457
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
src/tpl_wl_egl_thread.c

index 5c90ba7..fc8d525 100755 (executable)
@@ -143,6 +143,7 @@ struct _tpl_wl_egl_surface {
        tpl_bool_t                    prerotation_capability;
        tpl_bool_t                    vblank_done;
        tpl_bool_t                    set_serial_is_used;
+       tpl_bool_t                    message_processed;
 };
 
 struct _surface_vblank {
@@ -1754,7 +1755,9 @@ __tpl_wl_egl_surface_init(tpl_surface_t *surface)
        wl_egl_surface->sent_message = INIT_SURFACE;
        tpl_gsource_send_message(wl_egl_surface->surf_source,
                                                         wl_egl_surface->sent_message);
-       tpl_gcond_wait(&wl_egl_surface->surf_cond, &wl_egl_surface->surf_mutex);
+       do {
+               tpl_gcond_wait(&wl_egl_surface->surf_cond, &wl_egl_surface->surf_mutex);
+       } while (wl_egl_surface->sent_message != NONE_MESSAGE);
        tpl_gmutex_unlock(&wl_egl_surface->surf_mutex);
 
        TPL_ASSERT(wl_egl_surface->tbm_queue);