Skip to content

Commit

Permalink
Chore: remove an arc mutex that wasn't neccessary (#2462)
Browse files Browse the repository at this point in the history
  • Loading branch information
Blu-J authored Oct 16, 2023
1 parent 78faf88 commit afbab29
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions libs/js_engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,16 +351,14 @@ impl JsExecutionEnvironment {
startup_snapshot: Some(Snapshot::Static(SNAPSHOT_BYTES)),
..Default::default()
};
let runtime = Arc::new(Mutex::new(JsRuntime::new(runtime_options)));
let mut runtime = JsRuntime::new(runtime_options);

let future = async move {
let mod_id = runtime
.lock()
.await
.load_main_module(&"file:///loadModule.js".parse().unwrap(), None)
.await?;
let evaluated = runtime.lock().await.mod_evaluate(mod_id);
let res = runtime.lock().await.run_event_loop(false).await;
let evaluated = runtime.mod_evaluate(mod_id);
let res = runtime.run_event_loop(false).await;
res?;
evaluated.await??;
Ok::<_, AnyError>(())
Expand Down

0 comments on commit afbab29

Please sign in to comment.