From d75c086be5a5ca25efccf9423e182e816a6871a0 Mon Sep 17 00:00:00 2001 From: Shagun Garg Date: Wed, 26 Sep 2018 14:48:37 +0530 Subject: [PATCH] Support for MultiThreaded Applications This Patch makes the variable "wifi_direct_dbus_signal_map[]" thread specific. As a result, mutilple threads in a single application can maintain subscription/unsubscription for signals. Signed-off-by: Shagun Garg Signed-off-by: Nishant Chaprana Change-Id: If6a1cfa2563e47c54e61db5bf61dba46660f0869 --- packaging/capi-network-wifi-direct.spec | 2 +- src/wifi-direct-dbus.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packaging/capi-network-wifi-direct.spec b/packaging/capi-network-wifi-direct.spec index e82fc21..ec96580 100755 --- a/packaging/capi-network-wifi-direct.spec +++ b/packaging/capi-network-wifi-direct.spec @@ -3,7 +3,7 @@ Name: capi-network-wifi-direct Summary: Network WiFi-Direct Library -Version: 1.2.98 +Version: 1.2.99 Release: 1 Group: Network & Connectivity/API License: Apache-2.0 diff --git a/src/wifi-direct-dbus.c b/src/wifi-direct-dbus.c index 64fc304..92f5223 100644 --- a/src/wifi-direct-dbus.c +++ b/src/wifi-direct-dbus.c @@ -36,7 +36,7 @@ typedef struct { static __thread gdbus_connection_data gdbus_conn = {NULL, 0}; -static struct { +typedef struct { int sub_id; const char *interface; const char *member; @@ -47,7 +47,9 @@ static struct { const gchar *signal, GVariant *parameters, gpointer user_data); -} wifi_direct_dbus_signal_map[] = { +} wifi_direct_dbus_signal_map_s; + +static __thread wifi_direct_dbus_signal_map_s wifi_direct_dbus_signal_map[] = { { 0, WFD_MANAGER_MANAGE_INTERFACE, -- 2.7.4