Historically, the OSystem API used to have a method that allowed creating threads. Hence, mutex support was needed for thread syncing. To ease portability, we decided to remove the threading API. Instead, we now use timers (see setTimerCallback() and Common::Timer). But since those can be implemented using threads (and in fact, that is how our primary backend, the SDL one, does it on many systems), we still must do mutex syncing in our timer callbacks. In addition, the sound mixer uses a mutex in case the backend runs it from a dedicated thread (as the SDL backend does).
Hence, backends that do not use threads to implement the timers can simply use dummy implementations for these methods.
Functions | |
virtual Common::MutexInternal * | OSystem::createMutex ()=0 |
|
pure virtual |
Create a new mutex.
Implemented in OSystem_Android, OSystem_Wii, OSystem_N64, OSystem_Dreamcast, OSystem_DS, N3DS::OSystem_3DS, OSystem_iOS7, OSystem_PSP, OSystem_libretro, OSystem_SDL, and OSystem_Atari.