rust3ds / pthread-3ds

PThread implementation for Nintendo 3DS Horizon OS targets. Keep in mind that Horizon OS uses a cooperative, and not preemptive, threading model.
Apache License 2.0
12 stars 7 forks source link

Collect destructors, then run them to release lock #31

Closed ian-h-chamberlain closed 4 months ago

ian-h-chamberlain commented 4 months ago

Fixes #30

From what I can tell, some destructor that Rust registers ends up trying to modify or read KEYS as well, so we end up deadlocking because the lock was already held when we call that destructor.

I also made a change to set the args to null so we don't end up with lingering references to destructor args after running the destructor.