File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -62,4 +62,9 @@ impl RwLock {
6262 pub unsafe fn write_unlock ( & self ) {
6363 assert_eq ! ( self . mode. replace( 0 ) , -1 ) ;
6464 }
65+
66+ #[ inline]
67+ pub unsafe fn downgrade ( & self ) {
68+ assert_eq ! ( self . mode. replace( 1 ) , -1 ) ;
69+ }
6570}
Original file line number Diff line number Diff line change @@ -79,6 +79,12 @@ impl RwLock {
7979 let rwl = self . raw ( ) ;
8080 expect_success_aborting ( unsafe { abi:: rwl_unl_rwl ( rwl) } , & "rwl_unl_rwl" ) ;
8181 }
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+ }
8288}
8389
8490impl Drop for RwLock {
Original file line number Diff line number Diff line change @@ -41,4 +41,10 @@ impl RwLock {
4141 pub unsafe fn write_unlock ( & self ) {
4242 unsafe { self . inner . unlock ( ) } ;
4343 }
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+ }
4450}
You can’t perform that action at this time.
0 commit comments