зеркало из https://github.com/mozilla/gecko-dev.git
1f75d81c1c
SRWLock is more lightweight than CriticalSection, but is only available on Windows Vista and more. So until we actually dropped support Windows XP, we had to use CriticalSection. Now that all supported Windows versions do have SRWLock, this is a switch we can make, and not only because SRWLock is more lightweight, but because it can be statically initialized like on other platforms, allowing to use the same initialization code as on other platforms, and removing the requirement for a DllMain, which in turn can allow to statically link mozjemalloc in some cases, instead of requiring a shared library (DllMain only works on shared libraries), or manually call the initialization function soon enough. There is a downside, though: SRWLock, as opposed to CriticalSection, is not fair, meaning it can have thread scheduling implications, and can theoretically increase latency on some threads. However, it is the default used by Rust Mutex, meaning it's at least good enough there. Let's see how things go with this. --HG-- extra : rebase_source : 337dc4e245e461fd0ea23a2b6b53981346a545c6 |
||
---|---|---|
.. | ||
dmd | ||
logalloc | ||
moz.build |