thread: fix inconsistent return values

- SDL_CreateMutex returns NULL when the creation fails (ngage)
- SDL_SemValue returns 0 when the semaphore is NULL (n3ds)

(cherry picked from commit 6875e1c262)
This commit is contained in:
pionere
2022-11-29 11:18:30 +01:00
committed by Ryan C. Gordon
parent 89e9f7b42b
commit fcd7d658dc
2 changed files with 3 additions and 1 deletions

View File

@@ -114,7 +114,8 @@ Uint32
SDL_SemValue(SDL_sem *sem)
{
if (sem == NULL) {
return SDL_InvalidParamError("sem");
SDL_InvalidParamError("sem");
return 0;
}
return sem->semaphore.current_count;
}