docs(agc): record write tracker shutdown ordering

Document why the Driver singleton must initialize the guest write tracker before its static construction completes on Windows.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Avijit Singh 2026-10-12 00:19:27 +05:30
parent 471d9eced2
commit 2e0dcd7f57
1 changed files with 4 additions and 0 deletions

View File

@ -9,6 +9,10 @@
- libwinpthread-1.dll
- winpthreads initializes a statically initialized rwlock on its first lock and fails a concurrent first lock with `EINVAL`, which `std::shared_mutex` and `std::shared_timed_mutex` ignore, so that lock does not exclude. Guest rwlocks ([Pthread.hpp](../../core/libs/prx/libkernel/Pthread/include/Pthread.hpp)) are locked once when created. The host `std::shared_mutex` objects in [Recompiler.cpp](../../core/shader/recompiler/Recompiler.cpp) and [GuestWriteWatch.cpp](../../core/libs/prx/libc/src/GuestWriteWatch.cpp) are not, and can still race on their first contended use.
### Shutdown
- On Windows, console-control termination can run function-local static destructors through `ExitProcess`. `Driver::~Driver()` stops GPU state, which can access the guest write tracker. `Driver::Driver()` therefore initializes the tracker before the `Driver` singleton finishes construction, so reverse static-destruction order keeps the tracker alive through driver teardown.
### Silent stubs
Throughout the project, every function at every stage either **does exactly what it's supposed to or throws an exception**. Everywhere... except: