Skip to content

Stop using mutex_destroy(), when multiple threads can still access the mutex

Part of legacy/trac#31614 (moved), alternative to legacy/trac#31735 (moved).

If we can't join all the threads before destroying a mutex (legacy/trac#31735 (moved)), and we can't otherwise prevent multiple thread access, we should stop destroying that mutex. (Because destroying a locked thread invokes undefined behaviour.)

There may be some other pattern that helps us destroy all but one mutex. But that involves a "mutex-destruction" mutex. Which is terribly complex.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information