diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-09-21 11:41:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-21 11:41:51 +0200 |
commit | d1b88510cf31e1a9e5218f3195d15390e904f38a (patch) | |
tree | e73d6a8c6ec7702c0e96e12468697262d3229f95 | |
parent | 0a9d7e4e397a688dbd5d9448cdcbb119182ed446 (diff) |
refactor: remove GlobalState::compile_lock (#7598)
-rw-r--r-- | cli/global_state.rs | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/cli/global_state.rs b/cli/global_state.rs index 52bf48593..9205b4059 100644 --- a/cli/global_state.rs +++ b/cli/global_state.rs @@ -19,7 +19,6 @@ use std::env; use std::sync::atomic::AtomicUsize; use std::sync::Arc; use std::sync::Mutex; -use tokio::sync::Mutex as AsyncMutex; pub fn exit_unstable(api_name: &str) { eprintln!( @@ -43,7 +42,6 @@ pub struct GlobalState { pub lockfile: Option<Mutex<Lockfile>>, pub compiler_starts: AtomicUsize, pub maybe_import_map: Option<ImportMap>, - compile_lock: AsyncMutex<()>, } impl GlobalState { @@ -96,7 +94,6 @@ impl GlobalState { lockfile, maybe_import_map, compiler_starts: AtomicUsize::new(0), - compile_lock: AsyncMutex::new(()), }; Ok(Arc::new(global_state)) } @@ -116,10 +113,6 @@ impl GlobalState { ) -> Result<(), AnyError> { let module_specifier = module_specifier.clone(); - // TODO(ry) Try to lift compile_lock as high up in the call stack for - // sanity. - let compile_lock = self.compile_lock.lock().await; - let mut module_graph_loader = ModuleGraphLoader::new( self.file_fetcher.clone(), maybe_import_map, @@ -180,8 +173,6 @@ impl GlobalState { g.write()?; } - drop(compile_lock); - Ok(()) } @@ -195,17 +186,11 @@ impl GlobalState { module_specifier: ModuleSpecifier, _maybe_referrer: Option<ModuleSpecifier>, ) -> Result<CompiledModule, AnyError> { - let module_specifier = module_specifier.clone(); - let out = self .file_fetcher .fetch_cached_source_file(&module_specifier, Permissions::allow_all()) .expect("Cached source file doesn't exist"); - // TODO(ry) Try to lift compile_lock as high up in the call stack for - // sanity. - let compile_lock = self.compile_lock.lock().await; - // Check if we need to compile files let was_compiled = match out.media_type { MediaType::TypeScript | MediaType::TSX | MediaType::JSX => true, @@ -237,8 +222,6 @@ impl GlobalState { } }; - drop(compile_lock); - Ok(compiled_module) } |