diff options
author | kibak.yoon <kibak.yoon@samsung.com> | 2013-10-24 18:13:17 +0900 |
---|---|---|
committer | Jacek Bukarewicz <j.bukarewicz@samsung.com> | 2013-10-28 15:48:53 +0100 |
commit | 977c71736d0b1b5edb5ee172abe70aad4e544465 (patch) | |
tree | 9e38ad91527a2a2e271326ff6ac3819550f2aac6 | |
parent | 381ee6b97c9922b8193e14f076657addf6189a1f (diff) | |
download | libslp-sensor-977c71736d0b1b5edb5ee172abe70aad4e544465.tar.gz libslp-sensor-977c71736d0b1b5edb5ee172abe70aad4e544465.tar.bz2 libslp-sensor-977c71736d0b1b5edb5ee172abe70aad4e544465.zip |
adding lock for race conditionsubmit/tizen_ivi_panda/20140403.011908accepted/tizen/ivi/panda/20140403.014920tizen_ivi_pandaaccepted/tizen_ivi_panda
Change-Id: I24ecd1d2b54510bd8d57853996ed9296a46dfc9d
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
-rwxr-xr-x | src/client.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/client.cpp b/src/client.cpp index 952a919..759ab16 100755 --- a/src/client.cpp +++ b/src/client.cpp @@ -1586,9 +1586,11 @@ EXTAPI int sf_register_event(int handle , unsigned int event_type , event_condi memset(g_cb_table[i].call_back_key,'\0',MAX_KEY_LEN); snprintf(g_cb_table[i].call_back_key,(MAX_KEY_LEN-1),"%s%x",DEFAULT_SENSOR_KEY_PREFIX, event_type); + _lock.lock(); g_cb_table[i].cb_event_type = event_type; g_cb_table[i].client_data = cb_data; g_cb_table[i].sensor_callback_func_t = cb; + _lock.unlock(); switch (event_type ) { case ACCELEROMETER_EVENT_RAW_DATA_REPORT_ON_TIME: |