File tree 1 file changed +28
-0
lines changed
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -1247,6 +1247,34 @@ impl<T> Receiver<T> {
1247
1247
/// [`SyncSender`]: struct.SyncSender.html
1248
1248
/// [`Err`]: ../../../std/result/enum.Result.html#variant.Err
1249
1249
///
1250
+ /// # Known Issues
1251
+ ///
1252
+ /// There is currently a known issue (see [`#39364`]) that causes `recv_timeout`
1253
+ /// to panic unexpectedly with the following example:
1254
+ ///
1255
+ /// ```no_run
1256
+ /// use std::sync::mpsc::channel;
1257
+ /// use std::thread;
1258
+ /// use std::time::Duration;
1259
+ ///
1260
+ /// let (tx, rx) = channel::<String>();
1261
+ ///
1262
+ /// thread::spawn(move || {
1263
+ /// let d = Duration::from_millis(10);
1264
+ /// loop {
1265
+ /// println!("recv");
1266
+ /// let _r = rx.recv_timeout(d);
1267
+ /// }
1268
+ /// });
1269
+ ///
1270
+ /// thread::sleep(Duration::from_millis(100));
1271
+ /// let _c1 = tx.clone();
1272
+ ///
1273
+ /// thread::sleep(Duration::from_secs(1));
1274
+ /// ```
1275
+ ///
1276
+ /// [`#39364`]: https://github.com/rust-lang/rust/issues/39364
1277
+ ///
1250
1278
/// # Examples
1251
1279
///
1252
1280
/// Successfully receiving value before encountering timeout:
You can’t perform that action at this time.
0 commit comments