@@ -117,8 +117,7 @@ enum MutexKind {
117117}
118118
119119#[ derive( Debug , Clone , Copy ) ]
120- /// Additional data that we attach with each mutex instance.
121- struct MutexData {
120+ struct PthreadMutex {
122121 id : MutexId ,
123122 kind : MutexKind ,
124123}
@@ -173,10 +172,10 @@ fn mutex_create<'tcx>(
173172 ecx : & mut MiriInterpCx < ' tcx > ,
174173 mutex_ptr : & OpTy < ' tcx > ,
175174 kind : MutexKind ,
176- ) -> InterpResult < ' tcx , MutexData > {
175+ ) -> InterpResult < ' tcx , PthreadMutex > {
177176 let mutex = ecx. deref_pointer ( mutex_ptr) ?;
178177 let id = ecx. machine . sync . mutex_create ( ) ;
179- let data = MutexData { id, kind } ;
178+ let data = PthreadMutex { id, kind } ;
180179 lazy_sync_init ( ecx, & mutex, mutex_init_offset ( ecx) ?, data) ?;
181180 interp_ok ( data)
182181}
@@ -188,12 +187,12 @@ fn mutex_create<'tcx>(
188187fn mutex_get_data < ' tcx , ' a > (
189188 ecx : & ' a mut MiriInterpCx < ' tcx > ,
190189 mutex_ptr : & OpTy < ' tcx > ,
191- ) -> InterpResult < ' tcx , MutexData > {
190+ ) -> InterpResult < ' tcx , PthreadMutex > {
192191 let mutex = ecx. deref_pointer ( mutex_ptr) ?;
193192 lazy_sync_get_data ( ecx, & mutex, mutex_init_offset ( ecx) ?, "pthread_mutex_t" , |ecx| {
194193 let kind = mutex_kind_from_static_initializer ( ecx, & mutex) ?;
195194 let id = ecx. machine . sync . mutex_create ( ) ;
196- interp_ok ( MutexData { id, kind } )
195+ interp_ok ( PthreadMutex { id, kind } )
197196 } )
198197}
199198
@@ -228,8 +227,7 @@ fn mutex_kind_from_static_initializer<'tcx>(
228227// - init: u32
229228
230229#[ derive( Debug , Copy , Clone ) ]
231- /// Additional data that we attach with each rwlock instance.
232- struct RwLockData {
230+ struct PthreadRwLock {
233231 id : RwLockId ,
234232}
235233
@@ -261,7 +259,7 @@ fn rwlock_init_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> InterpResult<'tcx, Size
261259fn rwlock_get_data < ' tcx > (
262260 ecx : & mut MiriInterpCx < ' tcx > ,
263261 rwlock_ptr : & OpTy < ' tcx > ,
264- ) -> InterpResult < ' tcx , RwLockData > {
262+ ) -> InterpResult < ' tcx , PthreadRwLock > {
265263 let rwlock = ecx. deref_pointer ( rwlock_ptr) ?;
266264 lazy_sync_get_data ( ecx, & rwlock, rwlock_init_offset ( ecx) ?, "pthread_rwlock_t" , |ecx| {
267265 if !bytewise_equal_atomic_relaxed (
@@ -272,7 +270,7 @@ fn rwlock_get_data<'tcx>(
272270 throw_unsup_format ! ( "unsupported static initializer used for `pthread_rwlock_t`" ) ;
273271 }
274272 let id = ecx. machine . sync . rwlock_create ( ) ;
275- interp_ok ( RwLockData { id } )
273+ interp_ok ( PthreadRwLock { id } )
276274 } )
277275}
278276
@@ -366,8 +364,7 @@ enum ClockId {
366364}
367365
368366#[ derive( Debug , Copy , Clone ) ]
369- /// Additional data that we attach with each cond instance.
370- struct CondData {
367+ struct PthreadCondvar {
371368 id : CondvarId ,
372369 clock : ClockId ,
373370}
@@ -376,18 +373,18 @@ fn cond_create<'tcx>(
376373 ecx : & mut MiriInterpCx < ' tcx > ,
377374 cond_ptr : & OpTy < ' tcx > ,
378375 clock : ClockId ,
379- ) -> InterpResult < ' tcx , CondData > {
376+ ) -> InterpResult < ' tcx , PthreadCondvar > {
380377 let cond = ecx. deref_pointer ( cond_ptr) ?;
381378 let id = ecx. machine . sync . condvar_create ( ) ;
382- let data = CondData { id, clock } ;
379+ let data = PthreadCondvar { id, clock } ;
383380 lazy_sync_init ( ecx, & cond, cond_init_offset ( ecx) ?, data) ?;
384381 interp_ok ( data)
385382}
386383
387384fn cond_get_data < ' tcx > (
388385 ecx : & mut MiriInterpCx < ' tcx > ,
389386 cond_ptr : & OpTy < ' tcx > ,
390- ) -> InterpResult < ' tcx , CondData > {
387+ ) -> InterpResult < ' tcx , PthreadCondvar > {
391388 let cond = ecx. deref_pointer ( cond_ptr) ?;
392389 lazy_sync_get_data ( ecx, & cond, cond_init_offset ( ecx) ?, "pthread_cond_t" , |ecx| {
393390 if !bytewise_equal_atomic_relaxed (
@@ -399,7 +396,7 @@ fn cond_get_data<'tcx>(
399396 }
400397 // This used the static initializer. The clock there is always CLOCK_REALTIME.
401398 let id = ecx. machine . sync . condvar_create ( ) ;
402- interp_ok ( CondData { id, clock : ClockId :: Realtime } )
399+ interp_ok ( PthreadCondvar { id, clock : ClockId :: Realtime } )
403400 } )
404401}
405402
0 commit comments