@@ -117,8 +117,7 @@ enum MutexKind {
117
117
}
118
118
119
119
#[ derive( Debug , Clone , Copy ) ]
120
- /// Additional data that we attach with each mutex instance.
121
- struct MutexData {
120
+ struct PthreadMutex {
122
121
id : MutexId ,
123
122
kind : MutexKind ,
124
123
}
@@ -173,10 +172,10 @@ fn mutex_create<'tcx>(
173
172
ecx : & mut MiriInterpCx < ' tcx > ,
174
173
mutex_ptr : & OpTy < ' tcx > ,
175
174
kind : MutexKind ,
176
- ) -> InterpResult < ' tcx , MutexData > {
175
+ ) -> InterpResult < ' tcx , PthreadMutex > {
177
176
let mutex = ecx. deref_pointer ( mutex_ptr) ?;
178
177
let id = ecx. machine . sync . mutex_create ( ) ;
179
- let data = MutexData { id, kind } ;
178
+ let data = PthreadMutex { id, kind } ;
180
179
lazy_sync_init ( ecx, & mutex, mutex_init_offset ( ecx) ?, data) ?;
181
180
interp_ok ( data)
182
181
}
@@ -188,12 +187,12 @@ fn mutex_create<'tcx>(
188
187
fn mutex_get_data < ' tcx , ' a > (
189
188
ecx : & ' a mut MiriInterpCx < ' tcx > ,
190
189
mutex_ptr : & OpTy < ' tcx > ,
191
- ) -> InterpResult < ' tcx , MutexData > {
190
+ ) -> InterpResult < ' tcx , PthreadMutex > {
192
191
let mutex = ecx. deref_pointer ( mutex_ptr) ?;
193
192
lazy_sync_get_data ( ecx, & mutex, mutex_init_offset ( ecx) ?, "pthread_mutex_t" , |ecx| {
194
193
let kind = mutex_kind_from_static_initializer ( ecx, & mutex) ?;
195
194
let id = ecx. machine . sync . mutex_create ( ) ;
196
- interp_ok ( MutexData { id, kind } )
195
+ interp_ok ( PthreadMutex { id, kind } )
197
196
} )
198
197
}
199
198
@@ -228,8 +227,7 @@ fn mutex_kind_from_static_initializer<'tcx>(
228
227
// - init: u32
229
228
230
229
#[ derive( Debug , Copy , Clone ) ]
231
- /// Additional data that we attach with each rwlock instance.
232
- struct RwLockData {
230
+ struct PthreadRwLock {
233
231
id : RwLockId ,
234
232
}
235
233
@@ -261,7 +259,7 @@ fn rwlock_init_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> InterpResult<'tcx, Size
261
259
fn rwlock_get_data < ' tcx > (
262
260
ecx : & mut MiriInterpCx < ' tcx > ,
263
261
rwlock_ptr : & OpTy < ' tcx > ,
264
- ) -> InterpResult < ' tcx , RwLockData > {
262
+ ) -> InterpResult < ' tcx , PthreadRwLock > {
265
263
let rwlock = ecx. deref_pointer ( rwlock_ptr) ?;
266
264
lazy_sync_get_data ( ecx, & rwlock, rwlock_init_offset ( ecx) ?, "pthread_rwlock_t" , |ecx| {
267
265
if !bytewise_equal_atomic_relaxed (
@@ -272,7 +270,7 @@ fn rwlock_get_data<'tcx>(
272
270
throw_unsup_format ! ( "unsupported static initializer used for `pthread_rwlock_t`" ) ;
273
271
}
274
272
let id = ecx. machine . sync . rwlock_create ( ) ;
275
- interp_ok ( RwLockData { id } )
273
+ interp_ok ( PthreadRwLock { id } )
276
274
} )
277
275
}
278
276
@@ -366,8 +364,7 @@ enum ClockId {
366
364
}
367
365
368
366
#[ derive( Debug , Copy , Clone ) ]
369
- /// Additional data that we attach with each cond instance.
370
- struct CondData {
367
+ struct PthreadCondvar {
371
368
id : CondvarId ,
372
369
clock : ClockId ,
373
370
}
@@ -376,18 +373,18 @@ fn cond_create<'tcx>(
376
373
ecx : & mut MiriInterpCx < ' tcx > ,
377
374
cond_ptr : & OpTy < ' tcx > ,
378
375
clock : ClockId ,
379
- ) -> InterpResult < ' tcx , CondData > {
376
+ ) -> InterpResult < ' tcx , PthreadCondvar > {
380
377
let cond = ecx. deref_pointer ( cond_ptr) ?;
381
378
let id = ecx. machine . sync . condvar_create ( ) ;
382
- let data = CondData { id, clock } ;
379
+ let data = PthreadCondvar { id, clock } ;
383
380
lazy_sync_init ( ecx, & cond, cond_init_offset ( ecx) ?, data) ?;
384
381
interp_ok ( data)
385
382
}
386
383
387
384
fn cond_get_data < ' tcx > (
388
385
ecx : & mut MiriInterpCx < ' tcx > ,
389
386
cond_ptr : & OpTy < ' tcx > ,
390
- ) -> InterpResult < ' tcx , CondData > {
387
+ ) -> InterpResult < ' tcx , PthreadCondvar > {
391
388
let cond = ecx. deref_pointer ( cond_ptr) ?;
392
389
lazy_sync_get_data ( ecx, & cond, cond_init_offset ( ecx) ?, "pthread_cond_t" , |ecx| {
393
390
if !bytewise_equal_atomic_relaxed (
@@ -399,7 +396,7 @@ fn cond_get_data<'tcx>(
399
396
}
400
397
// This used the static initializer. The clock there is always CLOCK_REALTIME.
401
398
let id = ecx. machine . sync . condvar_create ( ) ;
402
- interp_ok ( CondData { id, clock : ClockId :: Realtime } )
399
+ interp_ok ( PthreadCondvar { id, clock : ClockId :: Realtime } )
403
400
} )
404
401
}
405
402
0 commit comments