Just install the signal handler once

This commit is contained in:
Lachlan Sneff 2019-03-05 16:50:49 -08:00
parent f36aade2e5
commit 0e5d1172d6

View File

@ -15,6 +15,7 @@ use std::{
mem,
ptr::{self, NonNull},
slice, str,
sync::Once,
};
use wasmer_runtime_core::{
backend::{FuncResolver, ProtectedCaller, Token, UserTrapper},
@ -258,9 +259,11 @@ impl LLVMBackend {
)
};
unsafe {
static SIGNAL_HANDLER_INSTALLED: Once = Once::new();
SIGNAL_HANDLER_INSTALLED.call_once(|| unsafe {
crate::platform::install_signal_handler();
}
});
if res != LLVMResult::OK {
panic!("failed to load object")