websocket test: remove special single-threaded mode

master
Jessie Murray 3 years ago
parent 9a758c6bcf
commit fd8f0b16e0
No known key found for this signature in database
GPG Key ID: E7E4D57EDDA744C5

@ -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;
}

Loading…
Cancel
Save