|
1 | 1 | // ignore-windows: Concurrency on Windows is not supported yet. |
2 | 2 | // compile-flags: -Zmiri-disable-isolation -Zmiri-check-number-validity |
3 | 3 |
|
4 | | -use std::sync::mpsc::{channel, sync_channel}; |
5 | 4 | use std::sync::{Arc, Barrier, Condvar, Mutex, Once, RwLock}; |
6 | 5 | use std::thread; |
7 | 6 | use std::time::{Duration, Instant}; |
@@ -181,52 +180,6 @@ fn check_rwlock_read_no_deadlock() { |
181 | 180 | handle.join().unwrap(); |
182 | 181 | } |
183 | 182 |
|
184 | | -// Check if channels are working. |
185 | | - |
186 | | -/// The test taken from the Rust documentation. |
187 | | -fn simple_send() { |
188 | | - let (tx, rx) = channel(); |
189 | | - thread::spawn(move || { |
190 | | - tx.send(10).unwrap(); |
191 | | - }); |
192 | | - assert_eq!(rx.recv().unwrap(), 10); |
193 | | -} |
194 | | - |
195 | | -/// The test taken from the Rust documentation. |
196 | | -fn multiple_send() { |
197 | | - let (tx, rx) = channel(); |
198 | | - for i in 0..10 { |
199 | | - let tx = tx.clone(); |
200 | | - thread::spawn(move || { |
201 | | - tx.send(i).unwrap(); |
202 | | - }); |
203 | | - } |
204 | | - |
205 | | - let mut sum = 0; |
206 | | - for _ in 0..10 { |
207 | | - let j = rx.recv().unwrap(); |
208 | | - assert!(0 <= j && j < 10); |
209 | | - sum += j; |
210 | | - } |
211 | | - assert_eq!(sum, 45); |
212 | | -} |
213 | | - |
214 | | -/// The test taken from the Rust documentation. |
215 | | -fn send_on_sync() { |
216 | | - let (sender, receiver) = sync_channel(1); |
217 | | - |
218 | | - // this returns immediately |
219 | | - sender.send(1).unwrap(); |
220 | | - |
221 | | - thread::spawn(move || { |
222 | | - // this will block until the previous message has been received |
223 | | - sender.send(2).unwrap(); |
224 | | - }); |
225 | | - |
226 | | - assert_eq!(receiver.recv().unwrap(), 1); |
227 | | - assert_eq!(receiver.recv().unwrap(), 2); |
228 | | -} |
229 | | - |
230 | 183 | // Check if Rust once statics are working. |
231 | 184 |
|
232 | 185 | static mut VAL: usize = 0; |
@@ -353,9 +306,6 @@ fn main() { |
353 | 306 | check_mutex(); |
354 | 307 | check_rwlock_write(); |
355 | 308 | check_rwlock_read_no_deadlock(); |
356 | | - simple_send(); |
357 | | - multiple_send(); |
358 | | - send_on_sync(); |
359 | 309 | check_once(); |
360 | 310 | check_rwlock_unlock_bug1(); |
361 | 311 | check_rwlock_unlock_bug2(); |
|
0 commit comments