Skip to content

Commit

Permalink
Renamed SDL_PostSemaphore() to SDL_SignalSemphore()
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jul 24, 2024
1 parent 27f86cb commit a7c0192
Show file tree
Hide file tree
Showing 31 changed files with 66 additions and 66 deletions.
2 changes: 1 addition & 1 deletion build-scripts/SDL_migration.cocci
Original file line number Diff line number Diff line change
Expand Up @@ -2511,7 +2511,7 @@ typedef SDL_atomic_t, SDL_AtomicInt;
@@
@@
- SDL_SemPost
+ SDL_PostSemaphore
+ SDL_SignalSemaphore
(...)
@@
@@
Expand Down
2 changes: 1 addition & 1 deletion docs/README-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,7 @@ The following functions have been renamed:
* SDL_CondWaitTimeout() => SDL_WaitConditionTimeout()
* SDL_CreateCond() => SDL_CreateCondition()
* SDL_DestroyCond() => SDL_DestroyCondition()
* SDL_SemPost() => SDL_PostSemaphore()
* SDL_SemPost() => SDL_SignalSemaphore()
* SDL_SemTryWait() => SDL_TryWaitSemaphore()
* SDL_SemValue() => SDL_GetSemaphoreValue()
* SDL_SemWait() => SDL_WaitSemaphore()
Expand Down
10 changes: 5 additions & 5 deletions include/SDL3/SDL_mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ typedef struct SDL_Semaphore SDL_Semaphore;
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_DestroySemaphore
* \sa SDL_PostSemaphore
* \sa SDL_SignalSemaphore
* \sa SDL_TryWaitSemaphore
* \sa SDL_GetSemaphoreValue
* \sa SDL_WaitSemaphore
Expand Down Expand Up @@ -583,7 +583,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_Semaphore *sem);
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_PostSemaphore
* \sa SDL_SignalSemaphore
* \sa SDL_TryWaitSemaphore
* \sa SDL_WaitSemaphoreTimeout
*/
Expand All @@ -604,7 +604,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_WaitSemaphore(SDL_Semaphore *sem);
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_PostSemaphore
* \sa SDL_SignalSemaphore
* \sa SDL_WaitSemaphore
* \sa SDL_WaitSemaphoreTimeout
*/
Expand All @@ -626,7 +626,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_TryWaitSemaphore(SDL_Semaphore *sem);
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_PostSemaphore
* \sa SDL_SignalSemaphore
* \sa SDL_TryWaitSemaphore
* \sa SDL_WaitSemaphore
*/
Expand All @@ -645,7 +645,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_WaitSemaphoreTimeout(SDL_Semaphore *sem, Sin
* \sa SDL_WaitSemaphore
* \sa SDL_WaitSemaphoreTimeout
*/
extern SDL_DECLSPEC int SDLCALL SDL_PostSemaphore(SDL_Semaphore *sem);
extern SDL_DECLSPEC int SDLCALL SDL_SignalSemaphore(SDL_Semaphore *sem);

/**
* Get the current value of a semaphore.
Expand Down
4 changes: 2 additions & 2 deletions include/SDL3/SDL_oldnames.h
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@
#define SDL_CondWaitTimeout SDL_WaitConditionTimeout
#define SDL_CreateCond SDL_CreateCondition
#define SDL_DestroyCond SDL_DestroyCondition
#define SDL_SemPost SDL_PostSemaphore
#define SDL_SemPost SDL_SignalSemaphore
#define SDL_SemTryWait SDL_TryWaitSemaphore
#define SDL_SemValue SDL_GetSemaphoreValue
#define SDL_SemWait SDL_WaitSemaphore
Expand Down Expand Up @@ -1065,7 +1065,7 @@
#define SDL_CondWaitTimeout SDL_CondWaitTimeout_renamed_SDL_WaitConditionTimeout
#define SDL_CreateCond SDL_CreateCond_renamed_SDL_CreateCondition
#define SDL_DestroyCond SDL_DestroyCond_renamed_SDL_DestroyCondition
#define SDL_SemPost SDL_SemPost_renamed_SDL_PostSemaphore
#define SDL_SemPost SDL_SemPost_renamed_SDL_SignalSemaphore
#define SDL_SemTryWait SDL_SemTryWait_renamed_SDL_TryWaitSemaphore
#define SDL_SemValue SDL_SemValue_renamed_SDL_GetSemaphoreValue
#define SDL_SemWait SDL_SemWait_renamed_SDL_WaitSemaphore
Expand Down
4 changes: 2 additions & 2 deletions src/audio/aaudio/SDL_aaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static void AAUDIO_errorCallback(AAudioStream *stream, void *userData, aaudio_re
// Just flag the device so we can kill it in PlayDevice instead.
SDL_AudioDevice *device = (SDL_AudioDevice *) userData;
SDL_AtomicSet(&device->hidden->error_callback_triggered, (int) error); // AAUDIO_OK is zero, so !triggered means no error.
SDL_PostSemaphore(device->hidden->semaphore); // in case we're blocking in WaitDevice.
SDL_SignalSemaphore(device->hidden->semaphore); // in case we're blocking in WaitDevice.
}

static aaudio_data_callback_result_t AAUDIO_dataCallback(AAudioStream *stream, void *userData, void *audioData, int32_t numFrames)
Expand Down Expand Up @@ -149,7 +149,7 @@ static aaudio_data_callback_result_t AAUDIO_dataCallback(AAudioStream *stream, v
size_t new_buffer_index = hidden->callback_bytes / device->buffer_size;
while (old_buffer_index < new_buffer_index) {
// Trigger audio processing
SDL_PostSemaphore(hidden->semaphore);
SDL_SignalSemaphore(hidden->semaphore);
++old_buffer_index;
}

Expand Down
4 changes: 2 additions & 2 deletions src/audio/coreaudio/SDL_coreaudio.m
Original file line number Diff line number Diff line change
Expand Up @@ -831,12 +831,12 @@ static int AudioQueueThreadEntry(void *arg)

if (PrepareAudioQueue(device) < 0) {
device->hidden->thread_error = SDL_strdup(SDL_GetError());
SDL_PostSemaphore(device->hidden->ready_semaphore);
SDL_SignalSemaphore(device->hidden->ready_semaphore);
return 0;
}

// init was successful, alert parent thread and start running...
SDL_PostSemaphore(device->hidden->ready_semaphore);
SDL_SignalSemaphore(device->hidden->ready_semaphore);

// This would be WaitDevice/WaitRecordingDevice in the normal SDL audio thread, but we get *BufferReadyCallback calls here to know when to iterate.
while (!SDL_AtomicGet(&device->shutdown)) {
Expand Down
6 changes: 3 additions & 3 deletions src/audio/openslES/SDL_openslES.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ static void bqRecorderCallback(SLAndroidSimpleBufferQueueItf bq, void *context)
struct SDL_PrivateAudioData *audiodata = (struct SDL_PrivateAudioData *)context;

LOGV("SLES: Recording Callback");
SDL_PostSemaphore(audiodata->playsem);
SDL_SignalSemaphore(audiodata->playsem);
}

static void OPENSLES_DestroyPCMRecorder(SDL_AudioDevice *device)
Expand Down Expand Up @@ -390,7 +390,7 @@ static void bqPlayerCallback(SLAndroidSimpleBufferQueueItf bq, void *context)
struct SDL_PrivateAudioData *audiodata = (struct SDL_PrivateAudioData *)context;

LOGV("SLES: Playback Callback");
SDL_PostSemaphore(audiodata->playsem);
SDL_SignalSemaphore(audiodata->playsem);
}

static void OPENSLES_DestroyPCMPlayer(SDL_AudioDevice *device)
Expand Down Expand Up @@ -673,7 +673,7 @@ static int OPENSLES_PlayDevice(SDL_AudioDevice *device, const Uint8 *buffer, int
// If Enqueue fails, callback won't be called.
// Post the semaphore, not to run out of buffer
if (SL_RESULT_SUCCESS != result) {
SDL_PostSemaphore(audiodata->playsem);
SDL_SignalSemaphore(audiodata->playsem);
}

return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/audio/pulseaudio/SDL_pulseaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ static int SDLCALL HotplugThread(void *data)
// don't WaitForPulseOperation on the subscription; when it's done we'll be able to get hotplug events, but waiting doesn't changing anything.
op = PULSEAUDIO_pa_context_subscribe(pulseaudio_context, PA_SUBSCRIPTION_MASK_SINK | PA_SUBSCRIPTION_MASK_SOURCE | PA_SUBSCRIPTION_MASK_SERVER, NULL, NULL);

SDL_PostSemaphore((SDL_Semaphore *) data);
SDL_SignalSemaphore((SDL_Semaphore *) data);

while (SDL_AtomicGet(&pulseaudio_hotplug_thread_active)) {
PULSEAUDIO_pa_threaded_mainloop_wait(pulseaudio_threaded_mainloop);
Expand Down
6 changes: 3 additions & 3 deletions src/audio/wasapi/SDL_wasapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static void ManagementThreadMainloop(void)
task->result = task->fn(task->userdata); // run this task.
if (task->task_complete_sem) { // something waiting on result?
task->errorstr = SDL_strdup(SDL_GetError());
SDL_PostSemaphore(task->task_complete_sem);
SDL_SignalSemaphore(task->task_complete_sem);
} else { // nothing waiting, we're done, free it.
SDL_free(task);
}
Expand Down Expand Up @@ -190,11 +190,11 @@ static int ManagementThreadEntry(void *userdata)

if (ManagementThreadPrepare() < 0) {
data->errorstr = SDL_strdup(SDL_GetError());
SDL_PostSemaphore(data->ready_sem); // unblock calling thread.
SDL_SignalSemaphore(data->ready_sem); // unblock calling thread.
return 0;
}

SDL_PostSemaphore(data->ready_sem); // unblock calling thread.
SDL_SignalSemaphore(data->ready_sem); // unblock calling thread.
ManagementThreadMainloop();

WASAPI_PlatformDeinit();
Expand Down
4 changes: 2 additions & 2 deletions src/audio/wasapi/SDL_wasapi_winrt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void SDL_WasapiDeviceEventHandler::OnEnumerationCompleted(DeviceWatcher ^ sender
{
SDL_assert(sender == this->watcher);
if (this->completed_semaphore) {
SDL_PostSemaphore(this->completed_semaphore);
SDL_SignalSemaphore(this->completed_semaphore);
}
}

Expand Down Expand Up @@ -283,7 +283,7 @@ HRESULT
SDL_WasapiActivationHandler::ActivateCompleted(IActivateAudioInterfaceAsyncOperation *async)
{
// Just set a flag, since we're probably in a different thread. We'll pick it up and init everything on our own thread to prevent races.
SDL_PostSemaphore(completion_semaphore);
SDL_SignalSemaphore(completion_semaphore);
return S_OK;
}

Expand Down
6 changes: 3 additions & 3 deletions src/core/android/SDL_android.c
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeSendQuit)(
}
/* Resume the event loop so that the app can catch SDL_EVENT_QUIT which
* should now be the top event in the event queue. */
SDL_PostSemaphore(Android_ResumeSem);
SDL_SignalSemaphore(Android_ResumeSem);
}

/* Activity ends */
Expand Down Expand Up @@ -1412,7 +1412,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativePause)(

/* Signal the pause semaphore so the event loop knows to pause and (optionally) block itself.
* Sometimes 2 pauses can be queued (eg pause/resume/pause), so it's always increased. */
SDL_PostSemaphore(Android_PauseSem);
SDL_SignalSemaphore(Android_PauseSem);
}

/* Resume */
Expand All @@ -1425,7 +1425,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeResume)(
* We can't restore the GL Context here because it needs to be done on the SDL main thread
* and this function will be called from the Java thread instead.
*/
SDL_PostSemaphore(Android_ResumeSem);
SDL_SignalSemaphore(Android_ResumeSem);
}

JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativeFocusChanged)(
Expand Down
6 changes: 3 additions & 3 deletions src/dynapi/SDL_dynapi.sym
Original file line number Diff line number Diff line change
Expand Up @@ -582,12 +582,12 @@ SDL3_0.0.0 {
SDL_Metal_GetLayer;
SDL_MinimizeWindow;
SDL_MixAudio;
SDL_OnApplicationDidEnterForeground;
SDL_OnApplicationDidChangeStatusBarOrientation;
SDL_OnApplicationDidEnterBackground;
SDL_OnApplicationDidEnterForeground;
SDL_OnApplicationDidReceiveMemoryWarning;
SDL_OnApplicationWillEnterForeground;
SDL_OnApplicationWillEnterBackground;
SDL_OnApplicationWillEnterForeground;
SDL_OnApplicationWillTerminate;
SDL_OpenAudioDevice;
SDL_OpenAudioDeviceStream;
Expand All @@ -612,7 +612,6 @@ SDL3_0.0.0 {
SDL_PenConnected;
SDL_PlayHapticRumble;
SDL_PollEvent;
SDL_PostSemaphore;
SDL_PremultiplyAlpha;
SDL_PremultiplySurfaceAlpha;
SDL_PumpEvents;
Expand Down Expand Up @@ -809,6 +808,7 @@ SDL3_0.0.0 {
SDL_ShowWindow;
SDL_ShowWindowSystemMenu;
SDL_SignalCondition;
SDL_SignalSemaphore;
SDL_StartTextInput;
SDL_StepUTF8;
SDL_StopHapticEffect;
Expand Down
6 changes: 3 additions & 3 deletions src/dynapi/SDL_dynapi_overrides.h
Original file line number Diff line number Diff line change
Expand Up @@ -607,12 +607,12 @@
#define SDL_Metal_GetLayer SDL_Metal_GetLayer_REAL
#define SDL_MinimizeWindow SDL_MinimizeWindow_REAL
#define SDL_MixAudio SDL_MixAudio_REAL
#define SDL_OnApplicationDidEnterForeground SDL_OnApplicationDidEnterForeground_REAL
#define SDL_OnApplicationDidChangeStatusBarOrientation SDL_OnApplicationDidChangeStatusBarOrientation_REAL
#define SDL_OnApplicationDidEnterBackground SDL_OnApplicationDidEnterBackground_REAL
#define SDL_OnApplicationDidEnterForeground SDL_OnApplicationDidEnterForeground_REAL
#define SDL_OnApplicationDidReceiveMemoryWarning SDL_OnApplicationDidReceiveMemoryWarning_REAL
#define SDL_OnApplicationWillEnterForeground SDL_OnApplicationWillEnterForeground_REAL
#define SDL_OnApplicationWillEnterBackground SDL_OnApplicationWillEnterBackground_REAL
#define SDL_OnApplicationWillEnterForeground SDL_OnApplicationWillEnterForeground_REAL
#define SDL_OnApplicationWillTerminate SDL_OnApplicationWillTerminate_REAL
#define SDL_OpenAudioDevice SDL_OpenAudioDevice_REAL
#define SDL_OpenAudioDeviceStream SDL_OpenAudioDeviceStream_REAL
Expand All @@ -637,7 +637,6 @@
#define SDL_PenConnected SDL_PenConnected_REAL
#define SDL_PlayHapticRumble SDL_PlayHapticRumble_REAL
#define SDL_PollEvent SDL_PollEvent_REAL
#define SDL_PostSemaphore SDL_PostSemaphore_REAL
#define SDL_PremultiplyAlpha SDL_PremultiplyAlpha_REAL
#define SDL_PremultiplySurfaceAlpha SDL_PremultiplySurfaceAlpha_REAL
#define SDL_PumpEvents SDL_PumpEvents_REAL
Expand Down Expand Up @@ -834,6 +833,7 @@
#define SDL_ShowWindow SDL_ShowWindow_REAL
#define SDL_ShowWindowSystemMenu SDL_ShowWindowSystemMenu_REAL
#define SDL_SignalCondition SDL_SignalCondition_REAL
#define SDL_SignalSemaphore SDL_SignalSemaphore_REAL
#define SDL_StartTextInput SDL_StartTextInput_REAL
#define SDL_StepUTF8 SDL_StepUTF8_REAL
#define SDL_StopHapticEffect SDL_StopHapticEffect_REAL
Expand Down
6 changes: 3 additions & 3 deletions src/dynapi/SDL_dynapi_procs.h
Original file line number Diff line number Diff line change
Expand Up @@ -618,12 +618,12 @@ SDL_DYNAPI_PROC(void,SDL_Metal_DestroyView,(SDL_MetalView a),(a),)
SDL_DYNAPI_PROC(void*,SDL_Metal_GetLayer,(SDL_MetalView a),(a),return)
SDL_DYNAPI_PROC(int,SDL_MinimizeWindow,(SDL_Window *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_MixAudio,(Uint8 *a, const Uint8 *b, SDL_AudioFormat c, Uint32 d, float e),(a,b,c,d,e),return)
SDL_DYNAPI_PROC(void,SDL_OnApplicationDidEnterForeground,(void),(),)
SDL_DYNAPI_PROC(void,SDL_OnApplicationDidChangeStatusBarOrientation,(void),(),)
SDL_DYNAPI_PROC(void,SDL_OnApplicationDidEnterBackground,(void),(),)
SDL_DYNAPI_PROC(void,SDL_OnApplicationDidEnterForeground,(void),(),)
SDL_DYNAPI_PROC(void,SDL_OnApplicationDidReceiveMemoryWarning,(void),(),)
SDL_DYNAPI_PROC(void,SDL_OnApplicationWillEnterForeground,(void),(),)
SDL_DYNAPI_PROC(void,SDL_OnApplicationWillEnterBackground,(void),(),)
SDL_DYNAPI_PROC(void,SDL_OnApplicationWillEnterForeground,(void),(),)
SDL_DYNAPI_PROC(void,SDL_OnApplicationWillTerminate,(void),(),)
SDL_DYNAPI_PROC(SDL_AudioDeviceID,SDL_OpenAudioDevice,(SDL_AudioDeviceID a, const SDL_AudioSpec *b),(a,b),return)
SDL_DYNAPI_PROC(SDL_AudioStream*,SDL_OpenAudioDeviceStream,(SDL_AudioDeviceID a, const SDL_AudioSpec *b, SDL_AudioStreamCallback c, void *d),(a,b,c,d),return)
Expand All @@ -648,7 +648,6 @@ SDL_DYNAPI_PROC(int,SDL_PeepEvents,(SDL_Event *a, int b, SDL_EventAction c, Uint
SDL_DYNAPI_PROC(SDL_bool,SDL_PenConnected,(SDL_PenID a),(a),return)
SDL_DYNAPI_PROC(int,SDL_PlayHapticRumble,(SDL_Haptic *a, float b, Uint32 c),(a,b,c),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_PollEvent,(SDL_Event *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_PostSemaphore,(SDL_Semaphore *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_PremultiplyAlpha,(int a, int b, SDL_PixelFormat c, const void *d, int e, SDL_PixelFormat f, void *g, int h, SDL_bool i),(a,b,c,d,e,f,g,h,i),return)
SDL_DYNAPI_PROC(int,SDL_PremultiplySurfaceAlpha,(SDL_Surface *a, SDL_bool b),(a,b),return)
SDL_DYNAPI_PROC(void,SDL_PumpEvents,(void),(),)
Expand Down Expand Up @@ -844,6 +843,7 @@ SDL_DYNAPI_PROC(int,SDL_ShowSimpleMessageBox,(SDL_MessageBoxFlags a, const char
SDL_DYNAPI_PROC(int,SDL_ShowWindow,(SDL_Window *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_ShowWindowSystemMenu,(SDL_Window *a, int b, int c),(a,b,c),return)
SDL_DYNAPI_PROC(int,SDL_SignalCondition,(SDL_Condition *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_SignalSemaphore,(SDL_Semaphore *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_StartTextInput,(SDL_Window *a),(a),return)
SDL_DYNAPI_PROC(Uint32,SDL_StepUTF8,(const char **a, size_t *b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_StopHapticEffect,(SDL_Haptic *a, int b),(a,b),return)
Expand Down
4 changes: 2 additions & 2 deletions src/joystick/hidapi/SDL_hidapi_rumble.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static void SDL_HIDAPI_StopRumbleThread(SDL_HIDAPI_RumbleContext *ctx)
if (ctx->thread) {
int result;

SDL_PostSemaphore(ctx->request_sem);
SDL_SignalSemaphore(ctx->request_sem);
SDL_WaitThread(ctx->thread, &result);
ctx->thread = NULL;
}
Expand Down Expand Up @@ -236,7 +236,7 @@ int SDL_HIDAPI_SendRumbleWithCallbackAndUnlock(SDL_HIDAPI_Device *device, const
/* Make sure we unlock before posting the semaphore so the rumble thread can run immediately */
SDL_HIDAPI_UnlockRumble();

SDL_PostSemaphore(ctx->request_sem);
SDL_SignalSemaphore(ctx->request_sem);

return size;
}
Expand Down
2 changes: 1 addition & 1 deletion src/sensor/android/SDL_androidsensor.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static int SDLCALL SDL_ANDROID_SensorThread(void *data)
SDL_SetThreadPriority(SDL_THREAD_PRIORITY_HIGH);

SDL_sensor_looper = ALooper_prepare(ALOOPER_PREPARE_ALLOW_NON_CALLBACKS);
SDL_PostSemaphore(ctx->sem);
SDL_SignalSemaphore(ctx->sem);

while (SDL_AtomicGet(&ctx->running)) {
Uint64 timestamp = SDL_GetTicksNS();
Expand Down
6 changes: 3 additions & 3 deletions src/thread/generic/SDL_syscond.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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!) :-)
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/thread/generic/SDL_sysmutex.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/thread/generic/SDL_syssem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down Expand Up @@ -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");
Expand Down
Loading

0 comments on commit a7c0192

Please sign in to comment.