Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions rs/moq-net/src/lite/subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use crate::{
coding::{Decode as _, Reader, Stream},
lite,
track::{Anchor, Position, Subscription},
util::SendCell,
};

use super::Version;
Expand Down Expand Up @@ -178,10 +179,13 @@ struct TrackEntry {
/// Where the subscription's groups go, once its TRACK_INFO says how to read them. A
/// SUBSCRIBE sent alongside its TRACK registers before.
copy: Option<Accepted>,
// Parked and paused groups hold group and frame writers, which reach the whole track
// model: the cells prove `Send` once here, so the session driver's proof stays within
// the default recursion limit.
/// The group streams that arrived before the copy, while any wait.
parked: Option<kio::Producer<Parked>>,
parked: Option<SendCell<kio::Producer<Parked>>>,
/// Lite-07: the groups a YIELDED reset paused, once one did or a stream waits on one.
paused: Option<kio::Producer<Paused>>,
paused: Option<SendCell<kio::Producer<Paused>>>,
/// Lite-07: the groups a stream that a YIELDED reset would pause is reading, one per
/// stream, so stream credit bounds them.
yielding: BTreeMap<u64, Yielding>,
Expand Down
8 changes: 7 additions & 1 deletion rs/moq-net/src/util/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ impl<T: Send + Sync> SendCell<T> {
}
}

// SAFETY: the only constructor requires T: Send + Sync. The private
impl<T: Default + Send + Sync> Default for SendCell<T> {
fn default() -> Self {
Self(T::default())
}
}

// SAFETY: both constructors require T: Send + Sync. The private
// field cannot be replaced with another type; cloning preserves T's bounds.
unsafe impl<T> Send for SendCell<T> {}

Expand Down