File tree 1 file changed +5
-10
lines changed
1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -49,21 +49,16 @@ impl RWLock {
49
49
#[ inline]
50
50
pub unsafe fn write_unlock ( & self ) { self . read_unlock ( ) }
51
51
#[ inline]
52
- #[ cfg( not( target_os = "dragonfly" ) ) ]
53
52
pub unsafe fn destroy ( & self ) {
54
- let r = ffi:: pthread_rwlock_destroy ( self . inner . get ( ) ) ;
55
- debug_assert_eq ! ( r, 0 ) ;
56
- }
57
-
58
- #[ inline]
59
- #[ cfg( target_os = "dragonfly" ) ]
60
- pub unsafe fn destroy ( & self ) {
61
- use libc;
62
53
let r = ffi:: pthread_rwlock_destroy ( self . inner . get ( ) ) ;
63
54
// On DragonFly pthread_rwlock_destroy() returns EINVAL if called on a
64
55
// rwlock that was just initialized with
65
56
// ffi::PTHREAD_RWLOCK_INITIALIZER. Once it is used (locked/unlocked)
66
57
// or pthread_rwlock_init() is called, this behaviour no longer occurs.
67
- debug_assert ! ( r == 0 || r == libc:: EINVAL ) ;
58
+ if cfg ! ( target_os = "dragonfly" ) {
59
+ debug_assert ! ( r == 0 || r == libc:: EINVAL ) ;
60
+ } else {
61
+ debug_assert_eq ! ( r, 0 ) ;
62
+ }
68
63
}
69
64
}
You can’t perform that action at this time.
0 commit comments