Closed brett19 closed 8 years ago
I think we should refactor all the tag-checks that use decaf_check(mutex && mutex->tag == OSMutex::Tag)
to use something like coreinit_tag_check(mutex)
with a definition in coreinit.h of #define coreinit_tag_check(obj) decaf_check(obj && obj->tag == decltype(obj)::Tag)
. This will allow us to have it off by default, but to enable it when debugging? On the other hand, if lots of games do this, perhaps we are better of just updating the OSMutex assertion such that tag == nullptr
is alright (it is a structure that does not NEED to be initialized).
This is already done. OSLockMutex now initializes the mutex if it was not already initialized. This is due to a common theme among games to reuse existing memory for new purposes without doing initialization for mutexes (but they do for most other things :/).
Some games just willie-nillie use mutexes without initializing them.