Commit Graph

5 Commits

Author SHA1 Message Date
lightningterror e8fe2eeb59 Revert "3rdparty/pthreads4w: Fixup process exit logic. (#3056)"
This reverts commit af6f040202.
2019-08-18 02:24:58 +02:00
lightningterror fc8423e49d Revert "3rdparty/pthreads4w: Ensure on_process_init early execution. (#3073)"
This reverts commit 88a02941f6.
2019-08-18 02:24:58 +02:00
Silent 88a02941f6 3rdparty/pthreads4w: Ensure on_process_init early execution. (#3073)
This fixes a semi-consistent regression introduced by #3056, where on_process_exit would execute before other destructors relying on pthreads.

Now on_process_init has been moved to an earlier section of static initializers, ensuring it will be initialized first. Previously, this initializer was placed in the same section as any other initializer, making their order of execution non-deterministic across compilations - for example, I was unable to reproduce this issue as soon as I forced pthreads4w.c to recompile last!
2019-08-16 17:22:29 +02:00
Silent af6f040202 3rdparty/pthreads4w: Fixup process exit logic. (#3056)
This PR modifies a third party module - I realize normally those should be fixed upstream, but I really doubt pthreads4w would a) consider it a valid bug and b) fix it. To make all my changes easily visible, I wrap them all in #if PCSX2_FIX.

This PR fixes a process exit routine in pthreads. This third party module exploits CRT initialization order to inject their initializer/deinitializer earlier than the others by putting their functions in .CRT$XCU and .CRT$XPU pseudo regions. The problem comes when a module gets build with dynamic CRT (/MD or /MDd), like most of PCSX2 plugins, it doesn't actually use .CRT$XPx regions as terminators, and instead lets dynamic CRT handle them.

This PR corrects this issue by registering the terminator via atexit, so it works with both static and dynamic CRT. This resolves an issue where SPU2-X plugin (and potentially more) leaks TLS handles when unloaded.
2019-08-13 18:32:41 +02:00
Miguel A. Colón Vélez 70aba9d3ff Update pthreads to 2.9.1
- It adds support for x64.
2015-08-25 09:00:12 -04:00