Fixes three interlocking concurrency leaks in the evdev hotkey listener flagged by the atomiser full-sweep. Every spawned task is now owned by a SupervisorHandle that broadcasts cooperative shutdown and joins every JoinHandle with a 2s per-task timeout on stop(). Per-device attachment is now insert-before-spawn under one mutex hold, closing the TOCTOU window. The Tauri command layer now stores the forwarder JoinHandle alongside the listener so reconfigures join it cleanly instead of leaking one permanent forwarder per hotkey change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
23 lines
916 B
TOML
23 lines
916 B
TOML
[package]
|
|
name = "lumotia-hotkey"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
description = "Wayland-compatible global hotkey listener for Lumotia — evdev backend with device hotplug"
|
|
|
|
[dependencies]
|
|
lumotia-core = { path = "../core" }
|
|
tokio = { version = "1", features = ["rt", "sync", "macros", "time"] }
|
|
serde = { version = "1", features = ["derive"] }
|
|
tracing = "0.1"
|
|
|
|
[target.'cfg(target_os = "linux")'.dependencies]
|
|
evdev = { version = "0.12", features = ["tokio"] }
|
|
notify = { version = "7", default-features = false, features = ["macos_fsevent"] }
|
|
nix = { version = "0.29", features = ["fs"] }
|
|
|
|
[dev-dependencies]
|
|
# `rt-multi-thread` enables `#[tokio::test(flavor = "multi_thread")]` used by
|
|
# the supervisor + listener lifecycle regression tests. Without it the
|
|
# concurrency leak coverage cannot exercise real parallelism.
|
|
tokio = { version = "1", features = ["rt", "rt-multi-thread", "sync", "macros", "time"] }
|