diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2020-10-10 05:41:11 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-10 11:41:11 +0200 |
commit | 08bb8b3d53eb2445de9b5e2845ab8acf9d353800 (patch) | |
tree | ebf00cb815ee1a10be00c74cbb332af33dd52dc2 /core/modules.rs | |
parent | 782e6a2ed5d76bb5a154c56d7daf4607e5bdb93f (diff) |
Fix 100% CPU idling problem by reverting #7672 (#7911)
* Revert "refactor: Worker is not a Future (#7895)"
This reverts commit f4357f0ff9d39411f22504fcc20db6bd5dec6ddb.
* Revert "refactor(core): JsRuntime is not a Future (#7855)"
This reverts commit d8879feb8c832dbb38649551b1cb0730874f7be6.
* Revert "fix(core): module execution with top level await (#7672)"
This reverts commit c7c767782538243ded64742dca9b34d6af74d62d.
Diffstat (limited to 'core/modules.rs')
-rw-r--r-- | core/modules.rs | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/core/modules.rs b/core/modules.rs index 1038dd84f..130becab8 100644 --- a/core/modules.rs +++ b/core/modules.rs @@ -341,13 +341,6 @@ pub struct ModuleInfo { pub name: String, pub handle: v8::Global<v8::Module>, pub import_specifiers: Vec<ModuleSpecifier>, - // TODO(bartlomieju): there should be "state" - // field that describes if module is already being loaded, - // so concurent dynamic imports don't introduce dead lock - // pub state: LoadState { - // Loading(shared_future), - // Loaded, - // }, } /// A symbolic module entity. @@ -674,7 +667,7 @@ mod tests { let a_id_fut = runtime.load_module(&spec, None); let a_id = futures::executor::block_on(a_id_fut).expect("Failed to load"); - futures::executor::block_on(runtime.mod_evaluate(a_id)).unwrap(); + runtime.mod_evaluate(a_id).unwrap(); let l = loads.lock().unwrap(); assert_eq!( l.to_vec(), @@ -741,7 +734,7 @@ mod tests { let result = runtime.load_module(&spec, None).await; assert!(result.is_ok()); let circular1_id = result.unwrap(); - runtime.mod_evaluate(circular1_id).await.unwrap(); + runtime.mod_evaluate(circular1_id).unwrap(); let l = loads.lock().unwrap(); assert_eq!( @@ -818,7 +811,7 @@ mod tests { println!(">> result {:?}", result); assert!(result.is_ok()); let redirect1_id = result.unwrap(); - runtime.mod_evaluate(redirect1_id).await.unwrap(); + runtime.mod_evaluate(redirect1_id).unwrap(); let l = loads.lock().unwrap(); assert_eq!( l.to_vec(), @@ -968,7 +961,7 @@ mod tests { let main_id = futures::executor::block_on(main_id_fut).expect("Failed to load"); - futures::executor::block_on(runtime.mod_evaluate(main_id)).unwrap(); + runtime.mod_evaluate(main_id).unwrap(); let l = loads.lock().unwrap(); assert_eq!( |