@@ -61,8 +61,7 @@ trait EvalContextExtPriv<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
6161let current_thread = this. get_active_thread ( ) ;
6262
6363if 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{
114113let 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 ( ) ;
116115if let Some ( old) = existing ( this, next_index) ? {
117116Ok ( 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 ( ) ) ;
120119assert_eq ! ( next_index, new_index) ;
121120Ok ( new_index)
122121}
@@ -125,7 +124,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
125124#[ inline]
126125fn init_once_status ( & mut self , id : InitOnceId ) -> InitOnceStatus {
127126let 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> {
137136callback : Box < dyn MachineCallback < ' mir , ' tcx > + ' tcx > ,
138137) {
139138let 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] ;
141140assert_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]
149148fn init_once_begin ( & mut self , id : InitOnceId ) {
150149let 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] ;
152151assert_eq ! (
153152 init_once. status,
154153InitOnceStatus :: Uninitialized ,
@@ -160,9 +159,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
160159#[ inline]
161160fn init_once_complete ( & mut self , id : InitOnceId ) -> InterpResult < ' tcx > {
162161let 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
167164assert_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
176173if 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]
190187fn init_once_fail ( & mut self , id : InitOnceId ) -> InterpResult < ' tcx > {
191188let 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] ;
195190assert_eq ! (
196191 init_once. status,
197192InitOnceStatus :: 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
202197if 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