From: Nishant Chaprana Date: Wed, 9 Oct 2019 12:23:21 +0000 (+0530) Subject: Fix double CONN_LOCK call leading to deadlock X-Git-Tag: submit/tizen/20191010.060003~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b23f01dea99c222dd7993e48e417c4fb26002bdd;p=platform%2Fcore%2Fapi%2Fconnection.git Fix double CONN_LOCK call leading to deadlock Change-Id: I4020c5d80514440899e0d16e05b9170e769bb478 Signed-off-by: Nishant Chaprana --- diff --git a/packaging/capi-network-connection.spec b/packaging/capi-network-connection.spec index 71bdb8e..b673b4e 100755 --- a/packaging/capi-network-connection.spec +++ b/packaging/capi-network-connection.spec @@ -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 diff --git a/src/connection.c b/src/connection.c index e53dcb3..61b87cb 100755 --- a/src/connection.c +++ b/src/connection.c @@ -209,13 +209,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; } @@ -224,11 +224,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; }