From 4057885ac3c82ed8726e32251b31c6f10fd98d69 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Sun, 12 Aug 2012 16:32:54 +0200 Subject: [PATCH] Decreased nesting in threads test. --- tests/threads.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tests/threads.c b/tests/threads.c index f19fdf88..de656e01 100644 --- a/tests/threads.c +++ b/tests/threads.c @@ -77,20 +77,18 @@ int main(void) exit(EXIT_FAILURE); } - if (thrd_create(&thread, thread_start, window) == thrd_success) - { - while (!glfwGetWindowParam(window, GLFW_CLOSE_REQUESTED)) - glfwWaitEvents(); - - running = GL_FALSE; - thrd_join(thread, &result); - } - else + if (thrd_create(&thread, thread_start, window) != thrd_success) { fprintf(stderr, "Failed to create secondary thread\n"); exit(EXIT_FAILURE); } + while (!glfwGetWindowParam(window, GLFW_CLOSE_REQUESTED)) + glfwWaitEvents(); + + running = GL_FALSE; + thrd_join(thread, &result); + exit(EXIT_SUCCESS); }