Skip to content

Commit 0efa831

Browse files
committed
Update documentation on ENTITY_LIFECYCLE_MUTEX
Signed-off-by: Michael X. Grey <[email protected]>
1 parent 21d3b35 commit 0efa831

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

rclrs/src/context.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,16 @@ use crate::{RclrsError, ToResult};
99

1010
/// This is locked whenever initializing or dropping any middleware entity
1111
/// 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
12+
/// make it unsafe to simultaneously initialize and/or drop middleware
13+
/// entities such as [`rcl_context_t`] and [`rcl_node_t`] as well middleware
14+
/// primitives such as [`rcl_publisher_t`], [`rcl_subscription_t`], etc.
15+
/// It seems these C and C++ based libraries will regularly use
1416
/// unprotected global variables in their object initialization and cleanup.
17+
///
18+
/// Further discussion with the RCL team may help to improve the RCL
19+
/// documentation to specifically call out where these risks are present. For
20+
/// now we lock this mutex for any RCL function that carries reasonable suspicion
21+
/// of a risk.
1522
pub(crate) static ENTITY_LIFECYCLE_MUTEX: Mutex<()> = Mutex::new(());
1623

1724
impl Drop for rcl_context_t {

0 commit comments

Comments
 (0)