File tree 1 file changed +2
-6
lines changed
1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -56,23 +56,19 @@ fn test_pipe_threaded() {
56
56
assert_eq ! ( res, 5 ) ;
57
57
assert_eq ! ( buf, "abcde" . as_bytes( ) ) ;
58
58
} ) ;
59
- // FIXME: we should yield here once blocking is implemented.
60
- //thread::yield_now();
59
+ thread:: yield_now ( ) ;
61
60
let data = "abcde" . as_bytes ( ) . as_ptr ( ) ;
62
61
let res = unsafe { libc:: write ( fds[ 1 ] , data as * const libc:: c_void , 5 ) } ;
63
62
assert_eq ! ( res, 5 ) ;
64
63
thread1. join ( ) . unwrap ( ) ;
65
64
66
65
// Read and write from different direction
67
66
let thread2 = thread:: spawn ( move || {
68
- // FIXME: we should yield here once blocking is implemented.
69
- //thread::yield_now();
67
+ thread:: yield_now ( ) ;
70
68
let data = "12345" . as_bytes ( ) . as_ptr ( ) ;
71
69
let res = unsafe { libc:: write ( fds[ 1 ] , data as * const libc:: c_void , 5 ) } ;
72
70
assert_eq ! ( res, 5 ) ;
73
71
} ) ;
74
- // FIXME: we should not yield here once blocking is implemented.
75
- thread:: yield_now ( ) ;
76
72
let mut buf: [ u8 ; 5 ] = [ 0 ; 5 ] ;
77
73
let res = unsafe { libc:: read ( fds[ 0 ] , buf. as_mut_ptr ( ) . cast ( ) , buf. len ( ) as libc:: size_t ) } ;
78
74
assert_eq ! ( res, 5 ) ;
You can’t perform that action at this time.
0 commit comments