@@ -125,11 +125,6 @@ struct ThreadData {
125125
126126 // Is the thread parked with a timeout?
127127 parked_with_timeout : Cell < bool > ,
128-
129- // Extra data for deadlock detection
130- // FIXME: once supported in stable replace with #[cfg...] & remove dummy struct/impl
131- #[ allow( dead_code) ]
132- deadlock_data : deadlock:: DeadlockData ,
133128}
134129
135130impl ThreadData {
@@ -148,7 +143,6 @@ impl ThreadData {
148143 unpark_token : Cell :: new ( DEFAULT_UNPARK_TOKEN ) ,
149144 park_token : Cell :: new ( DEFAULT_PARK_TOKEN ) ,
150145 parked_with_timeout : Cell :: new ( false ) ,
151- deadlock_data : deadlock:: DeadlockData :: new ( ) ,
152146 }
153147 }
154148}
@@ -601,8 +595,6 @@ unsafe fn park_internal(
601595 Some ( timeout) => thread_data. parker . park_until ( timeout) ,
602596 None => {
603597 thread_data. parker . park ( ) ;
604- // call deadlock detection on_unpark hook
605- deadlock:: on_unpark ( thread_data) ;
606598 true
607599 }
608600 } ;
@@ -1020,31 +1012,3 @@ unsafe fn unpark_filter_internal(
10201012
10211013 result
10221014}
1023-
1024- /// Just not supported when in libstd.
1025- pub mod deadlock {
1026- pub ( super ) struct DeadlockData { }
1027-
1028- impl DeadlockData {
1029- pub ( super ) fn new ( ) -> Self {
1030- DeadlockData { }
1031- }
1032- }
1033-
1034- /// Acquire a resource identified by key in the deadlock detector
1035- /// Noop if deadlock_detection feature isn't enabled.
1036- /// Note: Call after the resource is acquired
1037- #[ inline]
1038- pub unsafe fn acquire_resource ( _key : usize ) { }
1039-
1040- /// Release a resource identified by key in the deadlock detector.
1041- /// Noop if deadlock_detection feature isn't enabled.
1042- /// Note: Call before the resource is released
1043- /// # Panics
1044- /// Panics if the resource was already released or wasn't acquired in this thread.
1045- #[ inline]
1046- pub unsafe fn release_resource ( _key : usize ) { }
1047-
1048- #[ inline]
1049- pub ( super ) unsafe fn on_unpark ( _td : & super :: ThreadData ) { }
1050- }
0 commit comments