From fd8f0b16e0208308064ebc0ee8621d5c7fc0df52 Mon Sep 17 00:00:00 2001 From: Jessie Murray Date: Sat, 17 Jul 2021 21:46:01 -0700 Subject: [PATCH] websocket test: remove special single-threaded mode --- tests/websocket.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/tests/websocket.c b/tests/websocket.c index 6c90a3b..9a49ec2 100644 --- a/tests/websocket.c +++ b/tests/websocket.c @@ -500,20 +500,13 @@ main(int argc, char *argv[]) { workers[i].state = WS_INITIAL; workers[i].debug = verbose ? debug_verbose : debug_noop; workers[i].timeout_seconds = timeout_seconds; - if (thread_count == 1) { - printf("Single-threaded mode\n"); - worker_main(&workers[0]); - } else { /* create threads */ - pthread_create(&workers[i].thread, NULL, - worker_main, &workers[i]); - } + pthread_create(&workers[i].thread, NULL, + worker_main, &workers[i]); } /* wait for threads to finish */ for (i = 0; i < thread_count; ++i) { - if (thread_count > 1) { - pthread_join(workers[i].thread, NULL); - } + pthread_join(workers[i].thread, NULL); total += workers[i].msg_received; total_bytes += workers[i].byte_count; }