fix timing issue for mutex access in ble 33/17733/3
authorjihwan.seo <jihwan.seo@samsung.com>
Wed, 15 Feb 2017 10:21:37 +0000 (19:21 +0900)
committerDan Mihai <Daniel.Mihai@microsoft.com>
Fri, 10 Mar 2017 01:19:24 +0000 (01:19 +0000)
Change-Id: I95917e8788bf3abce8c8cc143c5cf645286a5d5e
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17733
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c
resource/csdk/stack/src/ocstack.c

index 596209d..7feee61 100644 (file)
@@ -2826,8 +2826,6 @@ CAResult_t CAInitializeLE(CARegisterConnectivityCallback registerCallback,
     }
     CAInitializeLEAdapter();
 
-    CASetLEClientThreadPoolHandle(handle);
-
     result = CAInitializeLEGattClient();
     if (CA_STATUS_OK != result)
     {
@@ -2835,6 +2833,8 @@ CAResult_t CAInitializeLE(CARegisterConnectivityCallback registerCallback,
         return CA_STATUS_FAILED;
     }
 
+    CASetLEClientThreadPoolHandle(handle);
+
     CASetLEReqRespClientCallback(CALEAdapterClientReceivedData);
     CASetLEServerThreadPoolHandle(handle);
     result = CAInitializeLEGattServer();
index fe0ca73..9a55134 100644 (file)
@@ -3590,6 +3590,7 @@ OCStackResult OCProcess()
 {
     if (stackState == OC_STACK_UNINITIALIZED)
     {
+        OIC_LOG(ERROR, TAG, "OCProcess has failed. ocstack is not initialized");
         return OC_STACK_ERROR;
     }
 #ifdef WITH_PRESENCE