Skip to content

Commit

Permalink
Update Context description
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowhatter committed May 25, 2024
1 parent 453f58a commit dfd2714
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions include/zenoh_commons.h
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,8 @@ typedef struct zc_threadsafe_context_data_t {
* information to each callback.
*
* This is a thread-safe context - the associated callbacks may be executed concurrently with the same
* zc_context_t instance. In other words, the context data MUST be thread-safe.
* zc_context_t instance. In other words, all the callbacks associated with this context data MUST be
* thread-safe.
*
* Once moved to zenoh-c ownership, this context is guaranteed to execute delete_fn when deleted.The
* delete_fn is guaranteed to be executed only once at some point of time after the last associated
Expand Down Expand Up @@ -1091,8 +1092,9 @@ typedef uint32_t z_protocol_id_t;
* information to each callback.
*
* This is a non-thread-safe context - zenoh-c guarantees that associated callbacks that share the same
* zc_context_t instance will never be executed concurrently. In other words, the context data is not
* required to be thread-safe.
* zc_context_t instance will never be executed concurrently. In other words, all the callbacks associated
* with this context data are not required to be thread-safe.
*
* NOTE: Remember that the same callback interfaces associated with different zc_context_t instances can
* still be executed concurrently. The exact behavior depends on user's application, but we strongly
* discourage our users from pinning to some specific behavior unless they _really_ understand what they
Expand Down
8 changes: 5 additions & 3 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ pub trait DroppableContext: Debug {
/// information to each callback.
///
/// This is a non-thread-safe context - zenoh-c guarantees that associated callbacks that share the same
/// zc_context_t instance will never be executed concurrently. In other words, the context data is not
/// required to be thread-safe.
/// zc_context_t instance will never be executed concurrently. In other words, all the callbacks associated
/// with this context data are not required to be thread-safe.
///
/// NOTE: Remember that the same callback interfaces associated with different zc_context_t instances can
/// still be executed concurrently. The exact behavior depends on user's application, but we strongly
/// discourage our users from pinning to some specific behavior unless they _really_ understand what they
Expand Down Expand Up @@ -71,7 +72,8 @@ impl Drop for Context {
/// information to each callback.
///
/// This is a thread-safe context - the associated callbacks may be executed concurrently with the same
/// zc_context_t instance. In other words, the context data MUST be thread-safe.
/// zc_context_t instance. In other words, all the callbacks associated with this context data MUST be
/// thread-safe.
///
/// Once moved to zenoh-c ownership, this context is guaranteed to execute delete_fn when deleted.The
/// delete_fn is guaranteed to be executed only once at some point of time after the last associated
Expand Down

0 comments on commit dfd2714

Please sign in to comment.