diff options
| author | bors <bors@rust-lang.org> | 2014-04-19 14:11:28 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-04-19 14:11:28 -0700 |
| commit | 3757f01c9bed7b2fe0d726ac45c754312e2917ea (patch) | |
| tree | 90ec1effb88282abaa0a0297ce3477f3c4ffff2a /src/libstd | |
| parent | 3db2b6933d33d9a27bfd82e6de083d4aebe75a3b (diff) | |
| parent | 29c291bb1b8cde76c022372b2f60df6db8d92e63 (diff) | |
| download | rust-3757f01c9bed7b2fe0d726ac45c754312e2917ea.tar.gz rust-3757f01c9bed7b2fe0d726ac45c754312e2917ea.zip | |
auto merge of #13610 : jsanders/rust/sender-try-send-docs, r=alexcrichton
I was getting a bit confused by these and (I think) managed to track it down to fallout from #13448 and #13465.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/comm/mod.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libstd/comm/mod.rs b/src/libstd/comm/mod.rs index 7700000b869..ce1c09af07c 100644 --- a/src/libstd/comm/mod.rs +++ b/src/libstd/comm/mod.rs @@ -479,7 +479,7 @@ impl<T: Send> Sender<T> { /// then the other end could immediately disconnect. /// /// The purpose of this functionality is to propagate failure among tasks. - /// If failure is not desired, then consider using the `try_send` method + /// If failure is not desired, then consider using the `send_opt` method pub fn send(&self, t: T) { if self.send_opt(t).is_err() { fail!("sending on a closed channel"); @@ -669,10 +669,10 @@ impl<T: Send> SyncSender<T> { /// Attempts to send a value on this channel without blocking. /// - /// This method semantically differs from `Sender::try_send` because it can - /// fail if the receiver has not disconnected yet. If the buffer on this - /// channel is full, this function will immediately return the data back to - /// the callee. + /// This method differs from `send_opt` by returning immediately if the + /// channel's buffer is full or no receiver is waiting to acquire some + /// data. Compared with `send_opt`, this function has two failure cases + /// instead of one (one for disconnection, one for a full buffer). /// /// See `SyncSender::send` for notes about guarantees of whether the /// receiver has received the data or not if this function is successful. |
