mcslock 0.4.2

An implementation of Mellor-Crummey and Scott contention-free lock for mutual exclusion, referred to as MCS lock.
Documentation
[env]
CFG_LOOM = "--cfg loom"
CLIPPY_FLAGS = "-D clippy::pedantic -D clippy::nursery"
CLIPPY_FLAGS_LOOM = "${CFG_LOOM} ${CLIPPY_FLAGS}"

# Don't run these tasks for all crates in the workspace.
[config]
default_to_workspace = false

# Install a "no_std" target.
[tasks.install-no-std-target]
command = "rustup"
args = ["target", "add", "thumbv7m-none-eabi"]

# Build package for no_std environment.
[tasks.no-std]
command = "cargo"
args = [
  "hack",
  "build",
  "--target",
  "thumbv7m-none-eabi",
  "--feature-powerset",
  "--no-dev-deps",
  "--skip",
  "yield,thread_local",
]
dependencies = ["install-no-std-target"]

# Build docs for docs.rs.
[tasks.docsrs]
toolchain = "nightly"
command = "cargo"
env = { "RUSTDOCFLAGS" = "--cfg docsrs" }
args = ["rustdoc", "--all-features", "--open", "--", "--default-theme", "ayu"]

# Check MSRV.
[tasks.msrv]
# NOTE: We are actually installing the first nightly 1.66.0. It should be
# equivalent to stable 1.65.0. We need the nightly version to use the sparse
# registry feature. This massively improves the index download.
# Link: https://blog.rust-lang.org/2022/06/22/sparse-registry-testing.html
toolchain = "nightly-2022-09-18"
command = "cargo"
env = { "CARGO_UNSTABLE_SPARSE_REGISTRY" = "true", "RUSTFLAGS" = "--allow unknown_lints" }
args = ["check", "--features=barging,thread_local,yield"]

# Check semver viloations.
[tasks.semver]
command = "cargo"
args = ["semver-checks", "${@}"]

# Run all documentation snippets.
[tasks.doc-test]
command = "cargo"
args = ["test", "--doc", "--all-features"]

# Lint all feature combinations with cargo-hack.
[tasks.lint]
command = "cargo"
env = { "RUSTFLAGS" = "${CLIPPY_FLAGS}" }
args = ["hack", "clippy", "--feature-powerset", "--no-dev-deps"]

# Run example.
[tasks.example]
command = "cargo"
env = { "RUSTFLAGS" = "${CLIPPY_FLAGS}" }
args = ["run", "--example", "${@}", "--all-features"]

# Lint all feature combinations with carg-hack on test profile.
[tasks.test-lint]
command = "cargo"
env = { "RUSTFLAGS" = "${CLIPPY_FLAGS}" }
args = [
  "hack",
  "clippy",
  "--profile",
  "test",
  "--feature-powerset",
  "--no-dev-deps",
]

# Run tests under miri.
# NOTE: must run as: `cargo +nightly make miri`.
[tasks.miri-test]
toolchain = "nightly"
install_crate = { rustup_component_name = "miri" }
command = "cargo"
args = ["miri", "nextest", "run", "--all-features", "${@}"]

# Check code coverage with tarpaulin (all features).
[tasks.tarpaulin]
command = "cargo"
args = ["tarpaulin", "--all-features", "--engine", "llvm", "--out", "xml"]

# Run Loom tests.
[tasks.loom-test]
command = "cargo"
env = { "RUSTFLAGS" = "${CFG_LOOM}" }
args = ["test", "--lib", "--release", "--all-features", "${@}"]

# Check Loom cfg (faster if using the same flags for rust-analyzer).
[tasks.loom-check]
command = "cargo"
env = { "RUSTFLAGS" = "${CFG_LOOM}" }
args = ["check", "--profile", "test", "--all-features"]

# Lint all feature combinations with cargo-hack on test profile and Loom cfg.
[tasks.loom-lint]
command = "cargo"
env = { "RUSTFLAGS" = "${CLIPPY_FLAGS_LOOM}" }
args = ["hack", "clippy", "--profile", "test", "--feature-powerset"]