Fix race condition with SCOPED_MAY_LOAD_LIBRARY_AT_BACKGROUND_PRIORITY
This CL is fixing a race condition that can happen when two threads are trying to load a DLL at the same time. The problem was that the priority boost may happen on the wrong thread (see: https://crbug.com/1124759). The solution is to add a std::atomic_bool already_loaded and set the flag when exiting the scope. It is fine that two threads enter the scope and try to load the DLL at the same time. Both thread will have and increased thread priority. R=gab@chromium.org, fdoray@chromium.org Bug: 1124759 Change-Id: I650ff99f56f1abeba6175024909cf344cad6bc61 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2392746Reviewed-by:François Doray <fdoray@chromium.org> Reviewed-by:
Gabriel Charette <gab@chromium.org> Commit-Queue: Etienne Bergeron <etienneb@chromium.org> Cr-Commit-Position: refs/heads/master@{#805083}
Showing
Please register or sign in to comment