about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authortiif <pekyuan@gmail.com>2025-02-21 00:06:50 +0800
committertiif <pekyuan@gmail.com>2025-02-21 00:06:50 +0800
commit2335fd69bc7a124eb37e366c3e4dc78a4a6774f6 (patch)
tree566417c114afe5dfeaee455b89af1482edb1c090 /src
parent83ecea2a1390da0781b87a2f6d73c0b8eef5b2ea (diff)
downloadrust-2335fd69bc7a124eb37e366c3e4dc78a4a6774f6.tar.gz
rust-2335fd69bc7a124eb37e366c3e4dc78a4a6774f6.zip
Resolve some FIXME from socketpair test
Diffstat (limited to 'src')
-rw-r--r--src/tools/miri/tests/pass-dep/libc/libc-socketpair.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/tools/miri/tests/pass-dep/libc/libc-socketpair.rs b/src/tools/miri/tests/pass-dep/libc/libc-socketpair.rs
index bbf0e215953..9163fd3d06f 100644
--- a/src/tools/miri/tests/pass-dep/libc/libc-socketpair.rs
+++ b/src/tools/miri/tests/pass-dep/libc/libc-socketpair.rs
@@ -88,8 +88,7 @@ fn test_socketpair_threaded() {
         assert_eq!(res, 5);
         assert_eq!(buf, "abcde".as_bytes());
     });
-    // FIXME: we should yield here once blocking is implemented.
-    //thread::yield_now();
+    thread::yield_now();
     let data = "abcde".as_bytes().as_ptr();
     let res = unsafe { libc::write(fds[0], data as *const libc::c_void, 5) };
     assert_eq!(res, 5);
@@ -97,14 +96,11 @@ fn test_socketpair_threaded() {
 
     // Read and write from different direction
     let thread2 = thread::spawn(move || {
-        // FIXME: we should yield here once blocking is implemented.
-        //thread::yield_now();
+        thread::yield_now();
         let data = "12345".as_bytes().as_ptr();
         let res = unsafe { libc::write(fds[1], data as *const libc::c_void, 5) };
         assert_eq!(res, 5);
     });
-    // FIXME: we should not yield here once blocking is implemented.
-    thread::yield_now();
     let mut buf: [u8; 5] = [0; 5];
     let res = unsafe { libc::read(fds[0], buf.as_mut_ptr().cast(), buf.len() as libc::size_t) };
     assert_eq!(res, 5);