mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-15 06:16:00 +00:00
Rename SDL mutex, semaphore and condition variable types to match SDL 3.0 naming convention
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
/* !!! FIXME: Should this be SDL_MUTEX_TIMEDOUT? */
|
||||
#define SDL_MUTEX_TIMEOUT -2
|
||||
|
||||
struct SDL_semaphore
|
||||
struct SDL_Semaphore
|
||||
{
|
||||
TInt handle;
|
||||
TInt count;
|
||||
@@ -65,7 +65,7 @@ static TInt NewSema(const TDesC &aName, TAny *aPtr1, TAny *aPtr2)
|
||||
return ((RSemaphore *)aPtr1)->CreateGlobal(aName, value);
|
||||
}
|
||||
|
||||
static void WaitAll(SDL_sem *sem)
|
||||
static void WaitAll(SDL_Semaphore *sem)
|
||||
{
|
||||
RSemaphore sema;
|
||||
sema.SetHandle(sem->handle);
|
||||
@@ -75,7 +75,7 @@ static void WaitAll(SDL_sem *sem)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_sem *
|
||||
SDL_Semaphore *
|
||||
SDL_CreateSemaphore(Uint32 initial_value)
|
||||
{
|
||||
RSemaphore s;
|
||||
@@ -83,13 +83,13 @@ SDL_CreateSemaphore(Uint32 initial_value)
|
||||
if (status != KErrNone) {
|
||||
SDL_SetError("Couldn't create semaphore");
|
||||
}
|
||||
SDL_semaphore *sem = new /*(ELeave)*/ SDL_semaphore;
|
||||
SDL_Semaphore *sem = new /*(ELeave)*/ SDL_Semaphore;
|
||||
sem->handle = s.Handle();
|
||||
sem->count = initial_value;
|
||||
return sem;
|
||||
}
|
||||
|
||||
void SDL_DestroySemaphore(SDL_sem *sem)
|
||||
void SDL_DestroySemaphore(SDL_Semaphore *sem)
|
||||
{
|
||||
if (sem != NULL) {
|
||||
RSemaphore sema;
|
||||
@@ -101,7 +101,7 @@ void SDL_DestroySemaphore(SDL_sem *sem)
|
||||
}
|
||||
}
|
||||
|
||||
int SDL_WaitSemaphoreTimeoutNS(SDL_sem *sem, Sint64 timeoutNS)
|
||||
int SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
|
||||
{
|
||||
if (sem == NULL) {
|
||||
return SDL_InvalidParamError("sem");
|
||||
@@ -140,7 +140,7 @@ int SDL_WaitSemaphoreTimeoutNS(SDL_sem *sem, Sint64 timeoutNS)
|
||||
}
|
||||
|
||||
Uint32
|
||||
SDL_GetSemaphoreValue(SDL_sem *sem)
|
||||
SDL_GetSemaphoreValue(SDL_Semaphore *sem)
|
||||
{
|
||||
if (sem == NULL) {
|
||||
SDL_InvalidParamError("sem");
|
||||
@@ -149,7 +149,7 @@ SDL_GetSemaphoreValue(SDL_sem *sem)
|
||||
return sem->count;
|
||||
}
|
||||
|
||||
int SDL_PostSemaphore(SDL_sem *sem)
|
||||
int SDL_PostSemaphore(SDL_Semaphore *sem)
|
||||
{
|
||||
if (sem == NULL) {
|
||||
return SDL_InvalidParamError("sem");
|
||||
|
Reference in New Issue
Block a user