Skip to content

Prevent CargoCleanTask & RustUpTargetAddTask from running in parallel

An error occurs when multiple cargoClean tasks that clean the same workspace run in parallel. This PR fixes that issue using a global lock as in RustUpTargetAddTask.

Changes

  • Added GloballyLockedTask. GloballyLockedTask.globalLock takes an identifier string and a code block and executes the code block while other code blocks with the same identifier are suspended.
  • Made CargoCleanTask and RustUpTargetAddTask use GloballyLockedTask.
    • CargoCleanTask does not block another CargoCleanTask if it cleans a different workspace.
    • RustUpTargetAddTask blocks every other RustUpTargetAddTask. For some reason, sometimes simultaneous rustup target add commands fail even when they're installing different triples.
Edited by Chanjung Kim

Merge request reports