@@ -588,13 +588,19 @@ static void verify_lock_unlock(const struct lock_context *where, struct lock *l)
588
588
check_held_for_unlock (& l -> info , where );
589
589
}
590
590
591
- static void verify_rw_init (const struct lock_context * where , struct rwlock * l )
591
+ static void verify_rw_init (const struct lock_context * where , struct rwlock * l ,
592
+ struct lock_class * lc )
592
593
{
593
- if (!l )
594
+ if (!l || ! lc )
594
595
print_invalid_call ("RWINIT" , where );
595
596
596
597
l -> info .magic = (uintptr_t ) & l -> info ;
597
598
l -> info .type = SYNCH_TYPE_RW ;
599
+
600
+ #ifdef JEFFPC_LOCK_TRACKING
601
+ l -> info .lc = lc ;
602
+ l -> info .name = where -> lockname ;
603
+ #endif
598
604
}
599
605
600
606
static void verify_rw_destroy (const struct lock_context * where , struct rwlock * l )
@@ -776,11 +782,12 @@ void mxunlock(const struct lock_context *where, struct lock *l)
776
782
where -> file , where -> line , strerror (ret ));
777
783
}
778
784
779
- void rwinit (const struct lock_context * where , struct rwlock * l )
785
+ void rwinit (const struct lock_context * where , struct rwlock * l ,
786
+ struct lock_class * lc )
780
787
{
781
788
int ret ;
782
789
783
- verify_rw_init (where , l );
790
+ verify_rw_init (where , l , lc );
784
791
785
792
ret = pthread_rwlock_init (& l -> lock , NULL );
786
793
if (ret )
0 commit comments