Hmm. Looks real; [`ScriptPreloader::WaitForCachedScript`](https://searchfox.org/mozilla-central/rev/6305f6935f496b3a302c7afcc579399a4217729c/js/xpconnect/loader/ScriptPreloader.cpp#875) calls `MaybeFinishOffThreadDecode()` three times, and doesn't consistently do acquire `mMonitor` first. [The first line of `MaybeFinishOffThreadDecode`](https://searchfox.org/mozilla-central/rev/6305f6935f496b3a302c7afcc579399a4217729c/js/xpconnect/loader/ScriptPreloader.cpp#964) reads `mToken` which I think has to be done with the lock held, since it is set [here](https://searchfox.org/mozilla-central/rev/6305f6935f496b3a302c7afcc579399a4217729c/js/xpconnect/loader/ScriptPreloader.cpp#930) with the mutex held. Kris, can you take this?
Bug 1601632 Comment 2 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Hmm. Looks real; [`ScriptPreloader::WaitForCachedScript`](https://searchfox.org/mozilla-central/rev/6305f6935f496b3a302c7afcc579399a4217729c/js/xpconnect/loader/ScriptPreloader.cpp#875) calls `MaybeFinishOffThreadDecode()` three times, sometimes with `mMonitor` held, sometimes not, which seems fishy. [The first line of `MaybeFinishOffThreadDecode`](https://searchfox.org/mozilla-central/rev/6305f6935f496b3a302c7afcc579399a4217729c/js/xpconnect/loader/ScriptPreloader.cpp#964) reads `mToken` which I think has to be done with the lock held, since it is set [here](https://searchfox.org/mozilla-central/rev/6305f6935f496b3a302c7afcc579399a4217729c/js/xpconnect/loader/ScriptPreloader.cpp#930) with the mutex held. Kris, can you take this?