Rename SDL mutex, semaphore and condition variable types to match SDL 3.0 naming convention

This commit is contained in:
Sam Lantinga
2023-04-28 07:31:12 -07:00
parent 61c0c009ab
commit 87ad71f9b2
75 changed files with 452 additions and 422 deletions

View File

@@ -24,21 +24,21 @@
#include "SDL_systhread_c.h"
struct SDL_mutex
struct SDL_Mutex
{
int recursive;
SDL_threadID owner;
SDL_sem *sem;
SDL_Semaphore *sem;
};
/* Create a mutex */
SDL_mutex *
SDL_Mutex *
SDL_CreateMutex(void)
{
SDL_mutex *mutex;
SDL_Mutex *mutex;
/* Allocate mutex memory */
mutex = (SDL_mutex *)SDL_calloc(1, sizeof(*mutex));
mutex = (SDL_Mutex *)SDL_calloc(1, sizeof(*mutex));
#ifndef SDL_THREADS_DISABLED
if (mutex) {
@@ -59,7 +59,7 @@ SDL_CreateMutex(void)
}
/* Free the mutex */
void SDL_DestroyMutex(SDL_mutex *mutex)
void SDL_DestroyMutex(SDL_Mutex *mutex)
{
if (mutex) {
if (mutex->sem) {
@@ -70,7 +70,7 @@ void SDL_DestroyMutex(SDL_mutex *mutex)
}
/* Lock the mutex */
int SDL_LockMutex(SDL_mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn't know about NULL mutexes */
int SDL_LockMutex(SDL_Mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn't know about NULL mutexes */
{
#ifdef SDL_THREADS_DISABLED
return 0;
@@ -99,7 +99,7 @@ int SDL_LockMutex(SDL_mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn
}
/* try Lock the mutex */
int SDL_TryLockMutex(SDL_mutex *mutex)
int SDL_TryLockMutex(SDL_Mutex *mutex)
{
#ifdef SDL_THREADS_DISABLED
return 0;
@@ -131,7 +131,7 @@ int SDL_TryLockMutex(SDL_mutex *mutex)
}
/* Unlock the mutex */
int SDL_UnlockMutex(SDL_mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn't know about NULL mutexes */
int SDL_UnlockMutex(SDL_Mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS /* clang doesn't know about NULL mutexes */
{
#ifdef SDL_THREADS_DISABLED
return 0;