Dont use lazy static to construct mutexes (#33047)

* Remove usage of lazy-static in background_hang_monitor

The lazy-static crate was only used to construct a mutex,
but since Mutex::new is const this can be done at compiletime
instead.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Remove usage of lazy-static in servoshell

Lazy-static was only used to construct a mutex, but
since Mutex::new is const this can simply be done at
compiletime.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2024-08-14 15:42:01 +02:00 committed by GitHub
parent d941d2fd67
commit c059bab6f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 2 additions and 12 deletions

View file

@ -22,9 +22,6 @@ libc = { workspace = true }
log = { workspace = true }
serde_json = { workspace = true }
[dev-dependencies]
lazy_static = { workspace = true }
[target.'cfg(target_os = "macos")'.dependencies]
mach2 = "0.4"

View file

@ -17,9 +17,7 @@ use background_hang_monitor_api::{
use base::id::TEST_PIPELINE_ID;
use ipc_channel::ipc;
lazy_static::lazy_static! {
static ref SERIAL: Mutex<()> = Mutex::new(());
}
static SERIAL: Mutex<()> = Mutex::new(());
#[test]
fn test_hang_monitoring() {