@@ -61,8 +61,7 @@ trait EvalContextExtPriv<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
6161 let current_thread = this. get_active_thread ( ) ;
6262
6363 if let Some ( data_race) = & this. machine . data_race {
64- data_race
65- . acquire_clock ( & this. machine . threads . sync . init_onces [ id] . clock , current_thread) ;
64+ data_race. acquire_clock ( & this. machine . sync . init_onces [ id] . clock , current_thread) ;
6665 }
6766 }
6867
@@ -112,11 +111,11 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
112111 ) -> InterpResult < ' tcx , Option < InitOnceId > > ,
113112 {
114113 let this = self . eval_context_mut ( ) ;
115- let next_index = this. machine . threads . sync . init_onces . next_index ( ) ;
114+ let next_index = this. machine . sync . init_onces . next_index ( ) ;
116115 if let Some ( old) = existing ( this, next_index) ? {
117116 Ok ( old)
118117 } else {
119- let new_index = this. machine . threads . sync . init_onces . push ( Default :: default ( ) ) ;
118+ let new_index = this. machine . sync . init_onces . push ( Default :: default ( ) ) ;
120119 assert_eq ! ( next_index, new_index) ;
121120 Ok ( new_index)
122121 }
@@ -125,7 +124,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
125124 #[ inline]
126125 fn init_once_status ( & mut self , id : InitOnceId ) -> InitOnceStatus {
127126 let this = self . eval_context_ref ( ) ;
128- this. machine . threads . sync . init_onces [ id] . status
127+ this. machine . sync . init_onces [ id] . status
129128 }
130129
131130 /// Put the thread into the queue waiting for the initialization.
@@ -137,7 +136,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
137136 callback : Box < dyn MachineCallback < ' mir , ' tcx > + ' tcx > ,
138137 ) {
139138 let this = self . eval_context_mut ( ) ;
140- let init_once = & mut this. machine . threads . sync . init_onces [ id] ;
139+ let init_once = & mut this. machine . sync . init_onces [ id] ;
141140 assert_ne ! ( init_once. status, InitOnceStatus :: Complete , "queueing on complete init once" ) ;
142141 init_once. waiters . push_back ( InitOnceWaiter { thread, callback } ) ;
143142 this. block_thread ( thread, BlockReason :: InitOnce ( id) ) ;
@@ -148,7 +147,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
148147 #[ inline]
149148 fn init_once_begin ( & mut self , id : InitOnceId ) {
150149 let this = self . eval_context_mut ( ) ;
151- let init_once = & mut this. machine . threads . sync . init_onces [ id] ;
150+ let init_once = & mut this. machine . sync . init_onces [ id] ;
152151 assert_eq ! (
153152 init_once. status,
154153 InitOnceStatus :: Uninitialized ,
@@ -160,9 +159,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
160159 #[ inline]
161160 fn init_once_complete ( & mut self , id : InitOnceId ) -> InterpResult < ' tcx > {
162161 let this = self . eval_context_mut ( ) ;
163- let current_thread = this. get_active_thread ( ) ;
164- let current_span = this. machine . current_span ( ) ;
165- let init_once = & mut this. machine . threads . sync . init_onces [ id] ;
162+ let init_once = & mut this. machine . sync . init_onces [ id] ;
166163
167164 assert_eq ! (
168165 init_once. status,
@@ -174,7 +171,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
174171
175172 // Each complete happens-before the end of the wait
176173 if let Some ( data_race) = & this. machine . data_race {
177- init_once. clock . clone_from ( & data_race. release_clock ( current_thread , current_span ) ) ;
174+ init_once. clock . clone_from ( & data_race. release_clock ( & this . machine . threads ) ) ;
178175 }
179176
180177 // Wake up everyone.
@@ -189,9 +186,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
189186 #[ inline]
190187 fn init_once_fail ( & mut self , id : InitOnceId ) -> InterpResult < ' tcx > {
191188 let this = self . eval_context_mut ( ) ;
192- let current_thread = this. get_active_thread ( ) ;
193- let current_span = this. machine . current_span ( ) ;
194- let init_once = & mut this. machine . threads . sync . init_onces [ id] ;
189+ let init_once = & mut this. machine . sync . init_onces [ id] ;
195190 assert_eq ! (
196191 init_once. status,
197192 InitOnceStatus :: Begun ,
@@ -200,7 +195,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
200195
201196 // Each complete happens-before the end of the wait
202197 if let Some ( data_race) = & this. machine . data_race {
203- init_once. clock . clone_from ( & data_race. release_clock ( current_thread , current_span ) ) ;
198+ init_once. clock . clone_from ( & data_race. release_clock ( & this . machine . threads ) ) ;
204199 }
205200
206201 // Wake up one waiting thread, so they can go ahead and try to init this.
0 commit comments