This was causing failures in automation that are preventing bug 1357829 from getting landed.
Created attachment 8876893 [details] [diff] [review] Move the hooks + don't EnsureWalkThreadReady EnsureWalkThreadReady takes two locks, one in _beginthreadex and another in the DLL hook setup. We can avoid the first by not calling EnsureWalkThreadReady if we're walking a suspended thread, since we won't be using a separate WalkThread anyway. To avoid the hook locks, I gave in and decided to go back to setting up the hooks in DllBlocklist_Initialize as originally planned.
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/ce749cd8209a Avoid locks in EnsureWalkThreadReady during the profiler's critical section. r=mstange