From 49c7aef5ed5474de781a2fdd8985da7a149e21ce Mon Sep 17 00:00:00 2001 From: David Bar-On Date: Thu, 25 Apr 2024 19:31:29 +0300 Subject: [PATCH] Per reviewer comments: switched lock and unlock --- src/iperf_error.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/iperf_error.c b/src/iperf_error.c index 078d79d0b..12ab3eb7d 100644 --- a/src/iperf_error.c +++ b/src/iperf_error.c @@ -110,8 +110,8 @@ iperf_errexit(struct iperf_test *test, const char *format, ...) } iperf_json_finish(test); } else { - if (pthread_mutex_unlock(&(test->print_mutex)) != 0) { - perror("iperf_errexit: pthread_mutex_unlock"); + if (pthread_mutex_lock(&(test->print_mutex)) != 0) { + perror("iperf_errexit: pthread_mutex_lock"); } if (test && test->outfile && test->outfile != stdout) { @@ -127,8 +127,8 @@ iperf_errexit(struct iperf_test *test, const char *format, ...) fprintf(stderr, "iperf3: %s\n", str); } - if (pthread_mutex_lock(&(test->print_mutex)) != 0) { - perror("iperf_errexit: pthread_mutex_lock"); + if (pthread_mutex_unlock(&(test->print_mutex)) != 0) { + perror("iperf_errexit: pthread_mutex_unlock"); } }