- To protect noti_tbl & client data in multi-thread situations
Change-Id: Ic1d2d29a86bffdfd5872c74109e2e92e51d1be5e
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
if (status != BUXTON_STATUS_CONNECTION_CLOSED)
return;
+ pthread_mutex_lock(&vconf_lock);
+ if (!noti_tbl) {
+ _refcnt = 0;
+ pthread_mutex_unlock(&vconf_lock);
+ return;
+ }
+
buxton_close(client);
r = buxton_open(&client, _restore_connection, NULL);
if (r == -1) {
_refcnt = 0;
LOGE("Can't connect to buxton: %d", errno);
+ pthread_mutex_unlock(&vconf_lock);
return;
}
g_hash_table_foreach(noti_tbl, (GHFunc)_restore_noti_cb, NULL);
+ pthread_mutex_unlock(&vconf_lock);
}
static int _open(void)