File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
library/std/src/sync/poison Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -608,6 +608,12 @@ impl<T: ?Sized> Mutex<T> {
608
608
let data = self . data . get_mut ( ) ;
609
609
poison:: map_result ( self . poison . borrow ( ) , |( ) | data)
610
610
}
611
+
612
+ /// Returns a raw pointer to the underlying data.
613
+ #[ unstable( feature = "mutex_data_ptr" , issue = "140368" ) ]
614
+ pub fn data_ptr ( & self ) -> * mut T {
615
+ self . data . get ( )
616
+ }
611
617
}
612
618
613
619
#[ stable( feature = "mutex_from" , since = "1.24.0" ) ]
Original file line number Diff line number Diff line change @@ -634,6 +634,12 @@ impl<T: ?Sized> RwLock<T> {
634
634
let data = self . data . get_mut ( ) ;
635
635
poison:: map_result ( self . poison . borrow ( ) , |( ) | data)
636
636
}
637
+
638
+ /// Returns a raw pointer to the underlying data.
639
+ #[ unstable( feature = "rwlock_data_ptr" , issue = "140368" ) ]
640
+ pub fn data_ptr ( & self ) -> * mut T {
641
+ self . data . get ( )
642
+ }
637
643
}
638
644
639
645
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
You can’t perform that action at this time.
0 commit comments