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 1
1
use crate :: sys:: rwlock as imp;
2
2
3
+ #[ cfg( unix) ]
3
4
enum GuardType {
4
5
Read ,
5
6
Write ,
6
7
}
7
8
9
+ #[ cfg( unix) ]
8
10
pub struct RWLockGuard ( & ' static RWLock , GuardType ) ;
9
11
12
+ #[ cfg( unix) ]
10
13
impl Drop for RWLockGuard {
11
14
fn drop ( & mut self ) {
12
15
unsafe {
@@ -52,6 +55,7 @@ impl RWLock {
52
55
/// Behavior is undefined if the rwlock has been moved between this and any
53
56
/// previous method call.
54
57
#[ inline]
58
+ #[ cfg( unix) ]
55
59
pub unsafe fn read_with_guard ( & ' static self ) -> RWLockGuard {
56
60
self . read ( ) ;
57
61
RWLockGuard ( & self , GuardType :: Read )
@@ -87,6 +91,7 @@ impl RWLock {
87
91
/// Behavior is undefined if the rwlock has been moved between this and any
88
92
/// previous method call.
89
93
#[ inline]
94
+ #[ cfg( unix) ]
90
95
pub unsafe fn write_with_guard ( & ' static self ) -> RWLockGuard {
91
96
self . write ( ) ;
92
97
RWLockGuard ( & self , GuardType :: Write )
You can’t perform that action at this time.
0 commit comments