serial = wl_display_next_serial(e_comp_wl->wl.disp);
wc = wl_resource_get_client(ec->comp_data->surface);
+ g_mutex_lock(&e_devicemgr->device_list_mutex);
EINA_LIST_FOREACH(e_devicemgr->device_list, l, input_dev)
{
if (!eina_streq(input_dev->identifier, dev_name) || (input_dev->clas != dev_class)) continue;
}
}
}
+ g_mutex_unlock(&e_devicemgr->device_list_mutex);
}
static void
dev_name = ecore_device_identifier_get(dev);
+ g_mutex_lock(&e_devicemgr->device_list_mutex);
EINA_LIST_FOREACH(e_devicemgr->device_list, l, input_dev)
{
if (!eina_streq(input_dev->identifier, dev_name) ||
tizen_input_device_send_event_device(dev_res, serial, input_dev->identifier, timestamp);
}
}
+ g_mutex_unlock(&e_devicemgr->device_list_mutex);
}
static void
dev_name = e_device_identifier_get(dev);
+ g_mutex_lock(&e_devicemgr->device_list_mutex);
EINA_LIST_FOREACH(e_devicemgr->device_list, l, input_dev)
{
if (!eina_streq(input_dev->identifier, dev_name) ||
tizen_input_device_send_event_device(dev_res, serial, input_dev->identifier, timestamp);
}
}
+ g_mutex_unlock(&e_devicemgr->device_list_mutex);
}
static void
f_value = wl_fixed_from_double(value);
wc = wl_resource_get_client(ec->comp_data->surface);
+ g_mutex_lock(&e_devicemgr->device_list_mutex);
EINA_LIST_FOREACH(e_devicemgr->device_list, l, input_dev)
{
if ((strcmp(input_dev->identifier, dev_name)) || (input_dev->clas != (Ecore_Device_Class)dev_class)) continue;
tizen_input_device_send_axis(dev_res, axis_type, f_value);
}
}
+ g_mutex_unlock(&e_devicemgr->device_list_mutex);
}
static void
e_devicemgr_conf_init(dconfig);
e_devicemgr->dconfig = dconfig;
+ g_mutex_init(&e_devicemgr->device_list_mutex);
+
res = e_devicemgr_wl_init();
EINA_SAFETY_ON_FALSE_GOTO(res, wl_failed);
EINTERN int
e_devicemgr_shutdown(void)
{
+ g_mutex_clear(&e_devicemgr->device_list_mutex);
eina_log_domain_unregister(_devicemgr_log_dom);
_devicemgr_log_dom = -1;
if (e_devicemgr->dconfig)
Eina_List *handlers;
+ GMutex device_list_mutex;
Eina_List *device_list;
E_Devicemgr_Input_Device *last_device_ptr;
E_Devicemgr_Input_Device *last_device_touch;
EINA_SAFETY_ON_NULL_RETURN(identifier);
EINA_SAFETY_ON_NULL_RETURN(e_devicemgr);
+ g_mutex_lock(&e_devicemgr->device_list_mutex);
EINA_LIST_FOREACH(e_devicemgr->device_list, l, dev)
{
if (!dev->name) continue;
(!strcmp(dev->name, name)) &&
(!strcmp(dev->identifier, identifier)))
{
+ g_mutex_unlock(&e_devicemgr->device_list_mutex);
return;
}
}
+ g_mutex_unlock(&e_devicemgr->device_list_mutex);
if (!(dev = E_NEW(E_Devicemgr_Input_Device, 1))) return;
dev->name = eina_stringshare_add(name);
dev->clas = clas;
dev->subclas = subclas;
+ g_mutex_lock(&e_devicemgr->device_list_mutex);
e_devicemgr->device_list = eina_list_append(e_devicemgr->device_list, dev);
+ g_mutex_unlock(&e_devicemgr->device_list_mutex);
if (dev->clas == ECORE_DEVICE_CLASS_MOUSE)
e_devicemgr->last_device_ptr = dev;
EINA_SAFETY_ON_NULL_RETURN(name);
EINA_SAFETY_ON_NULL_RETURN(identifier);
+ g_mutex_lock(&e_devicemgr->device_list_mutex);
EINA_LIST_FOREACH(e_devicemgr->device_list, l, dev)
{
if (!dev->name) continue;
(!strcmp(dev->identifier, identifier)))
break;
}
+ g_mutex_unlock(&e_devicemgr->device_list_mutex);
if (!dev)
{
return;
if (dev->identifier) eina_stringshare_del(dev->identifier);
if (dev->seat_name) eina_stringshare_del(dev->seat_name);
+ g_mutex_lock(&e_devicemgr->device_list_mutex);
e_devicemgr->device_list = eina_list_remove(e_devicemgr->device_list, dev);
+ g_mutex_unlock(&e_devicemgr->device_list_mutex);
if (e_devicemgr->last_device_ptr == dev)
e_devicemgr->last_device_ptr = NULL;
dev_identifier = (char *)ecore_device_identifier_get(dev);
EINA_SAFETY_ON_NULL_RETURN(dev_identifier);
+ g_mutex_lock(&e_devicemgr->device_list_mutex);
EINA_LIST_FOREACH(e_devicemgr->device_list, l, data)
{
if (data->clas == ecore_device_class_get(dev) && data->identifier)
data->subclas = ecore_device_subclass_get(dev);
e_devicemgr_wl_device_update(data);
+ g_mutex_unlock(&e_devicemgr->device_list_mutex);
return;
}
}
}
+ g_mutex_unlock(&e_devicemgr->device_list_mutex);
}
static Eina_Bool