Skip to content

Commit

Permalink
added comments to subscriptionhandle
Browse files Browse the repository at this point in the history
  • Loading branch information
GueLaKais committed Jun 26, 2024
1 parent 0ea5289 commit 0c2bb70
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rclrs/src/subscription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ pub struct SubscriptionHandle {
}

impl SubscriptionHandle {
/// Acquires the lock on the `rcl_subscription_t` and returns a mutable reference to it.
///
/// # Safety
///
/// This function is marked as unsafe because it returns a mutable reference to the
/// `rcl_subscription_t` struct, which could potentially be misused to violate safety
/// guarantees.
pub(crate) fn lock(&self) -> MutexGuard<rcl_subscription_t> {
self.rcl_subscription.lock().unwrap()
}
Expand Down

0 comments on commit 0c2bb70

Please sign in to comment.