expose eager thread-local initialization by the Engine

This commit is contained in:
Pat Hickey
2021-05-27 15:50:06 -07:00
parent 357b4c7b60
commit ff87f45604
3 changed files with 27 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
use crate::signatures::SignatureRegistry;
use crate::Config;
use crate::{Config, Trap};
use anyhow::Result;
use std::sync::Arc;
#[cfg(feature = "cache")]
@@ -63,6 +63,12 @@ impl Engine {
})
}
/// Eagerly initialize thread-local functionality shared by all [`Engine`]s. This
/// will be performed lazily by the runtime if users do not perform it eagerly.
pub fn tls_eager_initialize() -> Result<(), Trap> {
wasmtime_runtime::tls_eager_initialize().map_err(Trap::from_runtime)
}
/// Returns the configuration settings that this engine is using.
#[inline]
pub fn config(&self) -> &Config {