e_focus_policy_topmost: use atomic_load 53/309053/1
authorSooChan Lim <sc1.lim@samsung.com>
Thu, 4 Apr 2024 06:44:44 +0000 (15:44 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Thu, 4 Apr 2024 07:50:24 +0000 (16:50 +0900)
Get the focused ec using atomic_load for multi-threading environment.

Change-Id: I7a39fc2fc21a2290d978a210939cd035724accb3

src/bin/e_focus_policy_topmost.c

index a844899..1c47e09 100644 (file)
@@ -586,11 +586,14 @@ static E_Client *
 _focus_policy_topmost_focused_ec_get(E_Focus_Policy_Impl *impl)
 {
    E_Focus_Policy_Topmost *topmost_policy;
+   E_Client *focused_ec = NULL;
 
    topmost_policy = (E_Focus_Policy_Topmost *)impl;
    EINA_SAFETY_ON_NULL_RETURN_VAL(topmost_policy, NULL);
 
-   return topmost_policy->focused_ec;
+   focused_ec = atomic_load(&topmost_policy->focused_ec);
+
+   return focused_ec;
 }
 
 static Eina_Bool