Skip to content

Commit

Permalink
Merge pull request #4210 from tiif/small-fix-2
Browse files Browse the repository at this point in the history
Resolve more FIXMEs
  • Loading branch information
oli-obk authored Feb 26, 2025
2 parents 8ad3a49 + 88ceefe commit 76a3d31
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tests/pass-dep/libc/libc-pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,19 @@ fn test_pipe_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[1], data as *const libc::c_void, 5) };
assert_eq!(res, 5);
thread1.join().unwrap();

// 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);
Expand Down

0 comments on commit 76a3d31

Please sign in to comment.