No way to find out of an SDL_mutex was created

it would be nice if there was a function

bool SDL_mutexInitialized(SDL_mutex * mutex)

which returns false if the mutex was not created

SDL_CreateMutex should return NULL if something went wrong with initialization. Or are you referring to something else?

the point is that it could happen where a mutex has not been created because the call to SDL_CreateMutex() was not executed (for some reason). If another thread then tries to access that mutex (assuming it WAS created); things go bananas

Maybe I’m misunderstanding what you want to do, but SDL_CreateMutex returns a pointer so what you are asking doesn’t really make sense. You just need to make sure the mutex is created before it’s used.


you’re totally right ! I had a function that passed the mutex as a parameter but didn’t realize that this parameter could be checked NULL


to much programming and no play makes jeroen a dumb boy :slight_smile: