File tree 3 files changed +17
-0
lines changed
3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -62,4 +62,9 @@ impl RwLock {
62
62
pub unsafe fn write_unlock ( & self ) {
63
63
assert_eq ! ( self . mode. replace( 0 ) , -1 ) ;
64
64
}
65
+
66
+ #[ inline]
67
+ pub unsafe fn downgrade ( & self ) {
68
+ assert_eq ! ( self . mode. replace( 1 ) , -1 ) ;
69
+ }
65
70
}
Original file line number Diff line number Diff line change @@ -79,6 +79,12 @@ impl RwLock {
79
79
let rwl = self . raw ( ) ;
80
80
expect_success_aborting ( unsafe { abi:: rwl_unl_rwl ( rwl) } , & "rwl_unl_rwl" ) ;
81
81
}
82
+
83
+ #[ inline]
84
+ pub unsafe fn downgrade ( & self ) {
85
+ // The SOLID platform does not support the `downgrade` operation for reader writer locks, so
86
+ // this function is simply a no-op as only 1 reader can read: the original writer.
87
+ }
82
88
}
83
89
84
90
impl Drop for RwLock {
Original file line number Diff line number Diff line change @@ -41,4 +41,10 @@ impl RwLock {
41
41
pub unsafe fn write_unlock ( & self ) {
42
42
unsafe { self . inner . unlock ( ) } ;
43
43
}
44
+
45
+ #[ inline]
46
+ pub unsafe fn downgrade ( & self ) {
47
+ // Since there is no difference between read-locked and write-locked on this platform, this
48
+ // function is simply a no-op as only 1 reader can read: the original writer.
49
+ }
44
50
}
You can’t perform that action at this time.
0 commit comments