File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
library/std/src/sync/poison Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -610,6 +610,11 @@ impl<T: ?Sized> Mutex<T> {
610
610
}
611
611
612
612
/// Returns a raw pointer to the underlying data.
613
+ ///
614
+ /// The returned pointer is always non-null and properly aligned, but it is
615
+ /// the user's responsibility to ensure that any reads and writes through it
616
+ /// are properly synchronized to avoid data races, and that it is not read
617
+ /// or written through after the mutex is dropped.
613
618
#[ unstable( feature = "mutex_data_ptr" , issue = "140368" ) ]
614
619
pub fn data_ptr ( & self ) -> * mut T {
615
620
self . data . get ( )
Original file line number Diff line number Diff line change @@ -636,6 +636,11 @@ impl<T: ?Sized> RwLock<T> {
636
636
}
637
637
638
638
/// Returns a raw pointer to the underlying data.
639
+ ///
640
+ /// The returned pointer is always non-null and properly aligned, but it is
641
+ /// the user's responsibility to ensure that any reads and writes through it
642
+ /// are properly synchronized to avoid data races, and that it is not read
643
+ /// or written through after the lock is dropped.
639
644
#[ unstable( feature = "rwlock_data_ptr" , issue = "140368" ) ]
640
645
pub fn data_ptr ( & self ) -> * mut T {
641
646
self . data . get ( )
You can’t perform that action at this time.
0 commit comments