Merge "Fix double CONN_LOCK call leading to deadlock" into tizen
authorJaehyun Kim <jeik01.kim@samsung.com>
Thu, 10 Oct 2019 05:58:11 +0000 (05:58 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Thu, 10 Oct 2019 05:58:11 +0000 (05:58 +0000)
packaging/capi-network-connection.spec
src/connection.c

index 71bdb8e..b673b4e 100755 (executable)
@@ -1,6 +1,6 @@
 Name:          capi-network-connection
 Summary:       Network Connection library in TIZEN C API
-Version:       1.0.116
+Version:       1.0.117
 Release:       1
 Group:         System/Network
 License:       Apache-2.0
index 371ef54..b90606f 100755 (executable)
@@ -217,13 +217,13 @@ EXPORT_API int connection_create_cs(int tid, connection_h *connection)
 {
        int rv;
 
-       CONN_LOCK;
-
        rv = connection_create(connection);
-       if (rv == CONNECTION_ERROR_NONE)
+       if (rv == CONNECTION_ERROR_NONE) {
+               CONN_LOCK;
                _connection_set_cs_tid(tid, *connection);
+               CONN_UNLOCK;
+       }
 
-       CONN_UNLOCK;
        return rv;
 }
 
@@ -232,11 +232,11 @@ EXPORT_API int connection_destroy_cs(int tid, connection_h connection)
        int rv;
 
        CONN_LOCK;
-
        _connection_unset_cs_tid(tid, connection);
+       CONN_UNLOCK;
+
        rv = connection_destroy(connection);
 
-       CONN_UNLOCK;
        return rv;
 }