mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
Chore: remove an arc mutex that wasn't neccessary (#2462)
This commit is contained in:
@@ -351,16 +351,14 @@ impl JsExecutionEnvironment {
|
|||||||
startup_snapshot: Some(Snapshot::Static(SNAPSHOT_BYTES)),
|
startup_snapshot: Some(Snapshot::Static(SNAPSHOT_BYTES)),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
let runtime = Arc::new(Mutex::new(JsRuntime::new(runtime_options)));
|
let mut runtime = JsRuntime::new(runtime_options);
|
||||||
|
|
||||||
let future = async move {
|
let future = async move {
|
||||||
let mod_id = runtime
|
let mod_id = runtime
|
||||||
.lock()
|
|
||||||
.await
|
|
||||||
.load_main_module(&"file:///loadModule.js".parse().unwrap(), None)
|
.load_main_module(&"file:///loadModule.js".parse().unwrap(), None)
|
||||||
.await?;
|
.await?;
|
||||||
let evaluated = runtime.lock().await.mod_evaluate(mod_id);
|
let evaluated = runtime.mod_evaluate(mod_id);
|
||||||
let res = runtime.lock().await.run_event_loop(false).await;
|
let res = runtime.run_event_loop(false).await;
|
||||||
res?;
|
res?;
|
||||||
evaluated.await??;
|
evaluated.await??;
|
||||||
Ok::<_, AnyError>(())
|
Ok::<_, AnyError>(())
|
||||||
|
|||||||
Reference in New Issue
Block a user