Renamed SDL_PostSemaphore() to SDL_SignalSemphore()

This commit is contained in:
Sam Lantinga
2024-07-24 12:39:30 -07:00
parent 27f86cbe18
commit a7c0192017
31 changed files with 66 additions and 66 deletions

View File

@@ -103,7 +103,7 @@ int SDL_SignalCondition_generic(SDL_Condition *_cond)
SDL_LockMutex(cond->lock);
if (cond->waiting > cond->signals) {
++cond->signals;
SDL_PostSemaphore(cond->wait_sem);
SDL_SignalSemaphore(cond->wait_sem);
SDL_UnlockMutex(cond->lock);
SDL_WaitSemaphore(cond->wait_done);
} else {
@@ -133,7 +133,7 @@ int SDL_BroadcastCondition_generic(SDL_Condition *_cond)
num_waiting = (cond->waiting - cond->signals);
cond->signals = cond->waiting;
for (i = 0; i < num_waiting; ++i) {
SDL_PostSemaphore(cond->wait_sem);
SDL_SignalSemaphore(cond->wait_sem);
}
/* Now all released threads are blocked here, waiting for us.
Collect them all (and win fabulous prizes!) :-)
@@ -208,7 +208,7 @@ int SDL_WaitConditionTimeoutNS_generic(SDL_Condition *_cond, SDL_Mutex *mutex, S
SDL_WaitSemaphore(cond->wait_sem);
}
/* We always notify the signal thread that we are done */
SDL_PostSemaphore(cond->wait_done);
SDL_SignalSemaphore(cond->wait_done);
/* Signal handshake complete */
--cond->signals;

View File

@@ -124,7 +124,7 @@ void SDL_UnlockMutex(SDL_Mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS // clang d
then release the lock semaphore.
*/
mutex->owner = 0;
SDL_PostSemaphore(mutex->sem);
SDL_SignalSemaphore(mutex->sem);
}
}
#endif // SDL_THREADS_DISABLED

View File

@@ -46,7 +46,7 @@ Uint32 SDL_GetSemaphoreValue(SDL_Semaphore *sem)
return 0;
}
int SDL_PostSemaphore(SDL_Semaphore *sem)
int SDL_SignalSemaphore(SDL_Semaphore *sem)
{
return SDL_SetError("SDL not built with thread support");
}
@@ -153,7 +153,7 @@ Uint32 SDL_GetSemaphoreValue(SDL_Semaphore *sem)
return value;
}
int SDL_PostSemaphore(SDL_Semaphore *sem)
int SDL_SignalSemaphore(SDL_Semaphore *sem)
{
if (!sem) {
return SDL_InvalidParamError("sem");

View File

@@ -105,7 +105,7 @@ Uint32 SDL_GetSemaphoreValue(SDL_Semaphore *sem)
return sem->semaphore.current_count;
}
int SDL_PostSemaphore(SDL_Semaphore *sem)
int SDL_SignalSemaphore(SDL_Semaphore *sem)
{
if (!sem) {
return SDL_InvalidParamError("sem");

View File

@@ -147,7 +147,7 @@ Uint32 SDL_GetSemaphoreValue(SDL_Semaphore *sem)
return sem->count;
}
int SDL_PostSemaphore(SDL_Semaphore *sem)
int SDL_SignalSemaphore(SDL_Semaphore *sem)
{
if (!sem) {
return SDL_InvalidParamError("sem");

View File

@@ -121,7 +121,7 @@ Uint32 SDL_GetSemaphoreValue(SDL_Semaphore *sem)
return 0;
}
int SDL_PostSemaphore(SDL_Semaphore *sem)
int SDL_SignalSemaphore(SDL_Semaphore *sem)
{
int res;

View File

@@ -124,7 +124,7 @@ Uint32 SDL_GetSemaphoreValue(SDL_Semaphore *sem)
return 0;
}
int SDL_PostSemaphore(SDL_Semaphore *sem)
int SDL_SignalSemaphore(SDL_Semaphore *sem)
{
int res;

View File

@@ -162,7 +162,7 @@ Uint32 SDL_GetSemaphoreValue(SDL_Semaphore *sem)
return (Uint32)ret;
}
int SDL_PostSemaphore(SDL_Semaphore *sem)
int SDL_SignalSemaphore(SDL_Semaphore *sem)
{
int retval;

View File

@@ -126,7 +126,7 @@ Uint32 SDL_GetSemaphoreValue(SDL_Semaphore *sem)
return 0;
}
int SDL_PostSemaphore(SDL_Semaphore *sem)
int SDL_SignalSemaphore(SDL_Semaphore *sem)
{
int res;

View File

@@ -39,7 +39,7 @@ typedef SDL_Semaphore *(*pfnSDL_CreateSemaphore)(Uint32);
typedef void (*pfnSDL_DestroySemaphore)(SDL_Semaphore *);
typedef int (*pfnSDL_WaitSemaphoreTimeoutNS)(SDL_Semaphore *, Sint64);
typedef Uint32 (*pfnSDL_GetSemaphoreValue)(SDL_Semaphore *);
typedef int (*pfnSDL_PostSemaphore)(SDL_Semaphore *);
typedef int (*pfnSDL_SignalSemaphore)(SDL_Semaphore *);
typedef struct SDL_semaphore_impl_t
{
@@ -47,7 +47,7 @@ typedef struct SDL_semaphore_impl_t
pfnSDL_DestroySemaphore Destroy;
pfnSDL_WaitSemaphoreTimeoutNS WaitTimeoutNS;
pfnSDL_GetSemaphoreValue Value;
pfnSDL_PostSemaphore Post;
pfnSDL_SignalSemaphore Post;
} SDL_sem_impl_t;
/* Implementation will be chosen at runtime based on available Kernel features */
@@ -180,7 +180,7 @@ static Uint32 SDL_GetSemaphoreValue_atom(SDL_Semaphore *_sem)
return (Uint32)sem->count;
}
static int SDL_PostSemaphore_atom(SDL_Semaphore *_sem)
static int SDL_SignalSemaphore_atom(SDL_Semaphore *_sem)
{
SDL_sem_atom *sem = (SDL_sem_atom *)_sem;
@@ -199,7 +199,7 @@ static const SDL_sem_impl_t SDL_sem_impl_atom = {
&SDL_DestroySemaphore_atom,
&SDL_WaitSemaphoreTimeoutNS_atom,
&SDL_GetSemaphoreValue_atom,
&SDL_PostSemaphore_atom,
&SDL_SignalSemaphore_atom,
};
#endif /* !SDL_WINAPI_FAMILY_PHONE */
@@ -292,7 +292,7 @@ static Uint32 SDL_GetSemaphoreValue_kern(SDL_Semaphore *_sem)
return (Uint32)sem->count;
}
static int SDL_PostSemaphore_kern(SDL_Semaphore *_sem)
static int SDL_SignalSemaphore_kern(SDL_Semaphore *_sem)
{
SDL_sem_kern *sem = (SDL_sem_kern *)_sem;
if (!sem) {
@@ -316,7 +316,7 @@ static const SDL_sem_impl_t SDL_sem_impl_kern = {
&SDL_DestroySemaphore_kern,
&SDL_WaitSemaphoreTimeoutNS_kern,
&SDL_GetSemaphoreValue_kern,
&SDL_PostSemaphore_kern,
&SDL_SignalSemaphore_kern,
};
/**
@@ -376,7 +376,7 @@ Uint32 SDL_GetSemaphoreValue(SDL_Semaphore *sem)
return SDL_sem_impl_active.Value(sem);
}
int SDL_PostSemaphore(SDL_Semaphore *sem)
int SDL_SignalSemaphore(SDL_Semaphore *sem)
{
return SDL_sem_impl_active.Post(sem);
}