File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
library/std/src/sys_common Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 11use crate :: sys:: rwlock as imp;
22
3+ #[ cfg( unix) ]
34enum GuardType {
45 Read ,
56 Write ,
67}
78
9+ #[ cfg( unix) ]
810pub struct RWLockGuard ( & ' static RWLock , GuardType ) ;
911
12+ #[ cfg( unix) ]
1013impl Drop for RWLockGuard {
1114 fn drop ( & mut self ) {
1215 unsafe {
@@ -52,6 +55,7 @@ impl RWLock {
5255 /// Behavior is undefined if the rwlock has been moved between this and any
5356 /// previous method call.
5457 #[ inline]
58+ #[ cfg( unix) ]
5559 pub unsafe fn read_with_guard ( & ' static self ) -> RWLockGuard {
5660 self . read ( ) ;
5761 RWLockGuard ( & self , GuardType :: Read )
@@ -87,6 +91,7 @@ impl RWLock {
8791 /// Behavior is undefined if the rwlock has been moved between this and any
8892 /// previous method call.
8993 #[ inline]
94+ #[ cfg( unix) ]
9095 pub unsafe fn write_with_guard ( & ' static self ) -> RWLockGuard {
9196 self . write ( ) ;
9297 RWLockGuard ( & self , GuardType :: Write )
You can’t perform that action at this time.
0 commit comments