From 28dcb47cfa2c9788eca533e9131573ac9830f2c7 Mon Sep 17 00:00:00 2001 From: SS Roop Date: Mon, 18 Mar 2019 12:31:01 +0530 Subject: [PATCH] Remove extra locks causing deadlocks for wait_sync_flag function --- test/channels-cornercases.c | 1 - test/utils.c | 4 ---- 2 files changed, 5 deletions(-) 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; } -- 2.39.5