From: SS Roop Date: Mon, 18 Mar 2019 07:01:01 +0000 (+0530) Subject: Remove extra locks causing deadlocks for wait_sync_flag function X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=28dcb47cfa2c9788eca533e9131573ac9830f2c7;p=meshlink Remove extra locks causing deadlocks for wait_sync_flag function --- diff --git a/test/channels-cornercases.c b/test/channels-cornercases.c index ba4843d8..90762bc5 100644 --- a/test/channels-cornercases.c +++ b/test/channels-cornercases.c @@ -109,7 +109,6 @@ int main() { assert(nb); struct sync_flag channel_opened = {.flag = false}; - pthread_mutex_lock(&channel_opened.mutex); meshlink_channel_t *channel = meshlink_channel_open(a, nb, 7, a_receive_cb, NULL, 0); assert(channel); diff --git a/test/utils.c b/test/utils.c index 4cafa4b4..a2b7b143 100644 --- a/test/utils.c +++ b/test/utils.c @@ -87,15 +87,11 @@ void start_meshlink_pair(meshlink_handle_t *a, meshlink_handle_t *b) { a->priv = &pair_status; meshlink_set_node_status_cb(a, pair_status_cb); - pthread_mutex_lock(&pair_status.mutex); - meshlink_start(a); meshlink_start(b); assert(wait_sync_flag(&pair_status, 5)); - pthread_mutex_unlock(&pair_status.mutex); - meshlink_set_node_status_cb(a, NULL); a->priv = NULL; }