Page 1 of 1

LWP_MutexLock always returns error

Posted: Tue Jun 09, 2020 4:50 pm
by shenglee
I'm trying to port a game that uses SDL to the Wii. Using sdl-wii I managed to port other software (e.g. emulators) without too much trouble. In this case, however, I'm having trouble with mutexes. The implementation of sdl-wii calls LWP_MutexLock to lock a mutex but it always returns an error code (-1). The mutex is initialized previously with LWP_MutexInit, but I don't know if there are other initialization steps that are necessary. I've taken a look at the code for LWP_MutexLock and other mutex operations in libogc but it didn't help me much.

Does anyone have an idea why this is happening? Otherwise, is there any further documentation or examples using threads and mutexes with devkitPPC? Thanks.

Re: LWP_MutexLock always returns error

Posted: Mon Jun 22, 2020 7:59 pm
by WinterMute
It's not clear if your problem is with SDL or with LWP mutexes here. Can you supply some code snippets by any chance?

We also finally got around to collating a few SDL ports and updating SDL's configury for Wii & Gamecube support so we now have official SDL packages available via pacman. It would be nice if you could test your ports with those packages and let is know if you find any problems. We do recommend removing the libogc, portlibs/wii, portlibs/gamecube and portlibs/ppc folders before reinstalling the official packages you need. Unfortunately libraries provided elsewhere are likely to cause issues.