Skip to content

Commit 4caa208

Browse files
committed
Remove the need for lazy_static
Signed-off-by: Michael X. Grey <mxgrey@intrinsic.ai>
1 parent 6d90431 commit 4caa208

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

rclrs/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ cfg-if = "1.0.0"
2323
# Needed for clients
2424
futures = "0.3"
2525

26-
# Needed to create a global mutex for managing the lifecycles of middleware entities
27-
lazy_static = "1.4"
28-
2926
# Needed for dynamic messages
3027
libloading = { version = "0.8", optional = true }
3128

rclrs/src/context.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ use std::vec::Vec;
77
use crate::rcl_bindings::*;
88
use crate::{RclrsError, ToResult};
99

10-
lazy_static::lazy_static! {
11-
/// This is locked whenever initializing or dropping any middleware entity
12-
/// because we have found issues in RCL and some RMW implementations that
13-
/// make it unsafe to simultaneously initialize and/or drop various types of
14-
/// entities. It seems these C and C++ based libraries will regularly use
15-
/// unprotected global variables in their object initialization and cleanup.
16-
pub(crate) static ref ENTITY_LIFECYCLE_MUTEX: Mutex<()> = Mutex::new(());
17-
}
10+
/// This is locked whenever initializing or dropping any middleware entity
11+
/// because we have found issues in RCL and some RMW implementations that
12+
/// make it unsafe to simultaneously initialize and/or drop various types of
13+
/// entities. It seems these C and C++ based libraries will regularly use
14+
/// unprotected global variables in their object initialization and cleanup.
15+
pub(crate) static ENTITY_LIFECYCLE_MUTEX: Mutex<()> = Mutex::new(());
1816

1917
impl Drop for rcl_context_t {
2018
fn drop(&mut self) {

0 commit comments

Comments
 (0)