From 1c3463c27470783a5b6807a91628a71f33b91090 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Thu, 15 Dec 2016 19:05:11 +0000 Subject: mu-threads: Fix windows thread and semaphore creation Was returning errors on successful creation. --- source/helpers/mu-threads/mu-threads.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/helpers/mu-threads/mu-threads.c b/source/helpers/mu-threads/mu-threads.c index 72fb259c..58c725a2 100644 --- a/source/helpers/mu-threads/mu-threads.c +++ b/source/helpers/mu-threads/mu-threads.c @@ -61,7 +61,7 @@ void mu_unlock_mutex(mu_mutex *mutex) int mu_create_semaphore(mu_semaphore *sem) { sem->handle = CreateSemaphore(NULL, 0, 1, NULL); - return (sem->handle != NULL); + return (sem->handle == NULL); } void mu_destroy_semaphore(mu_semaphore *sem) @@ -103,7 +103,7 @@ int mu_create_thread(mu_thread *th, mu_thread_fn *fn, void *arg) th->arg = arg; th->handle = CreateThread(NULL, 0, thread_starter, th, 0, NULL); - return (th->handle != NULL); + return (th->handle == NULL); } void mu_destroy_thread(mu_thread *th) -- cgit v1.2.3