From c02862b550e2d4e5c79c13debea8beda483f56ff Mon Sep 17 00:00:00 2001 From: bumbread Date: Sun, 19 Feb 2023 02:06:30 +1100 Subject: [PATCH] threads test --- test/test_threads.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/test/test_threads.c b/test/test_threads.c index ebbb723..965e6a2 100644 --- a/test/test_threads.c +++ b/test/test_threads.c @@ -16,19 +16,19 @@ int f(void* thr_data) { int main(void) { tss_create(&key, NULL); - // thrd_t thread; - // int status = thrd_create(&thread, f, NULL); - // if(status == thrd_error) { - // puts("Failed creating threads"); - // } - // for(int n = 0; n < 10; ++n) { - // counter++; - // } + thrd_t thread; + int status = thrd_create(&thread, f, NULL); + if(status == thrd_error) { + puts("Failed creating threads"); + } + for(int n = 0; n < 10; ++n) { + counter++; + } tss_set(key, "Thread 1 finished"); - // int res; - // if(thrd_join(thread, &res) == thrd_error) { - // puts("Failed waiting on thread"); - // } + int res; + if(thrd_join(thread, &res) == thrd_error) { + puts("Failed waiting on thread"); + } puts(tss_get(key)); tss_delete(key); }