e_keyrouter: call connection_lock/unlock when sending events in keyrouter 83/303383/1
authorJoonbum Ko <joonbum.ko@samsung.com>
Tue, 19 Dec 2023 04:33:09 +0000 (13:33 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Wed, 27 Dec 2023 02:01:31 +0000 (11:01 +0900)
 - When callsing some protocol that causes wl_resource_post_event,
  if the main thread locks the connection_mutex and becomes runnable status
  due to CPU contention, the input thread waits at the mutex lock
  inside wayland.
 - e_comp_wl_connection_mutex_lock() will call boostig API
  for main thread when its trylock has been failed.

Change-Id: I320d910f1307d6a895943fc89f369f607c9ca850
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
src/bin/e_keyrouter.c
src/bin/e_keyrouter_wl.c

index af26d7bacb0c5fe129c8dc2e500d4713df47d2a0..8effe3eed72b0343e3edaef2fee4bf4ac0b8775d 100644 (file)
@@ -631,7 +631,9 @@ e_keyrouter_event_surface_send(E_Client *ec, int key)
    EINA_SAFETY_ON_NULL_RETURN(surface);
    key = key - 8;
 
+   e_comp_wl_connection_lock();
    e_keyrouter_wl_event_surface_send(surface, key, TIZEN_KEYROUTER_MODE_NONE);
+   e_comp_wl_connection_unlock();
 }
 
 EINTERN void
index 16eb8696b23db90b40978bfeed815005a4d73b24..7e9004f368e4526b3894afe061a2b542d72776bf 100644 (file)
@@ -51,7 +51,9 @@ _e_keyrouter_wl_key_send(Ecore_Event_Key *ev, E_Device *dev, enum wl_keyboard_ke
 
    if (surface && !focused)
      {
+        e_comp_wl_connection_lock();
         e_keyrouter_wl_event_surface_send(surface, ev->keycode, TIZEN_KEYROUTER_MODE_NONE);
+        e_comp_wl_connection_unlock();
      }
 
    if (e_config->key_input_ttrace_enable)