]> git.feebdaed.xyz Git - 0xmirror/SOEM.git/commitdiff
Add win32 mutex
authorHans-Erik Floryd <hans-erik.floryd@rt-labs.com>
Thu, 24 Apr 2025 08:15:32 +0000 (10:15 +0200)
committerHans-Erik Floryd <hans-erik.floryd@rt-labs.com>
Wed, 9 Jul 2025 10:15:39 +0000 (12:15 +0200)
Change-Id: I40a29cfa3f3b669f04140b6dcf572d0e8d2f6509

osal/win32/osal.c

index d2fd180007a691b72e0b9dad4cf7d5d4d2e6381a..35e4aafbe7cfc16fbbdd4f2df9ac5a816371bbae 100644 (file)
@@ -152,3 +152,23 @@ int osal_thread_create_rt(void *thandle, int stacksize, void *func, void *param)
    }
    return ret;
 }
+
+void *osal_mutex_create(void)
+{
+   return CreateMutex (NULL, FALSE, NULL);
+}
+
+void osal_mutex_destroy(void *mutex)
+{
+   CloseHandle (mutex);
+}
+
+void osal_mutex_lock(void *mutex)
+{
+   WaitForSingleObject (mutex, INFINITE);
+}
+
+void osal_mutex_unlock(void *mutex)
+{
+   ReleaseMutex (mutex);
+}