mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 20:01:50 +00:00
bug 1358151: temporary workaround for rust race condition r=ted
MozReview-Commit-ID: KiPArBKMSu1 --HG-- extra : rebase_source : 7e0714b0bb04f019fc26dae80cf1226d298551c3
This commit is contained in:
parent
82c29b3dff
commit
72c896fa45
@ -19,6 +19,16 @@ use std::ffi::CStr;
|
||||
use std::os::raw::c_char;
|
||||
use std::panic;
|
||||
|
||||
|
||||
|
||||
// This workaround is fixed in Rust 1.19. For details, see bug 1358151.
|
||||
thread_local!(static UNUSED_THREAD_LOCAL: () = ());
|
||||
#[no_mangle]
|
||||
pub extern "C" fn rust_init_please_remove_this_after_updating_rust_1_19() {
|
||||
UNUSED_THREAD_LOCAL.with(|_| ());
|
||||
}
|
||||
|
||||
|
||||
/// Used to implement `nsIDebug2::RustPanic` for testing purposes.
|
||||
#[no_mangle]
|
||||
pub extern "C" fn intentional_panic(message: *const c_char) {
|
||||
|
@ -224,6 +224,12 @@
|
||||
extern uint32_t gRestartMode;
|
||||
extern void InstallSignalHandlers(const char *ProgramName);
|
||||
|
||||
// This workaround is fixed in Rust 1.19. For details, see bug 1358151.
|
||||
// Implementation in toolkit/library/rust/shared/lib.rs
|
||||
extern "C" {
|
||||
void rust_init_please_remove_this_after_updating_rust_1_19();
|
||||
}
|
||||
|
||||
#define FILE_COMPATIBILITY_INFO NS_LITERAL_CSTRING("compatibility.ini")
|
||||
#define FILE_INVALIDATE_CACHES NS_LITERAL_CSTRING(".purgecaches")
|
||||
|
||||
@ -3114,6 +3120,9 @@ XREMain::XRE_mainInit(bool* aExitFlag)
|
||||
return 1;
|
||||
*aExitFlag = false;
|
||||
|
||||
// This workaround is fixed in Rust 1.19. For details, see bug 1358151.
|
||||
rust_init_please_remove_this_after_updating_rust_1_19();
|
||||
|
||||
atexit(UnexpectedExit);
|
||||
auto expectedShutdown = mozilla::MakeScopeExit([&] {
|
||||
MozExpectedExit();
|
||||
|
Loading…
x
Reference in New Issue
Block a user