Skip to content

Commit 9f562f5

Browse files
committed
add comments to no-op downgrades
1 parent d4e15f3 commit 9f562f5

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

library/std/src/sys/sync/rwlock/solid.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ impl RwLock {
8282

8383
#[inline]
8484
pub unsafe fn downgrade(&self) {
85-
todo!()
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.
8687
}
8788
}
8889

library/std/src/sys/sync/rwlock/teeos.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,8 @@ impl RwLock {
4343
}
4444

4545
#[inline]
46-
pub unsafe fn downgrade(&self) {}
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 a no-op.
49+
}
4750
}

0 commit comments

Comments
 (0)