diff --git a/compiler-rt/lib/tsan/rtl/tsan_libdispatch.cc b/compiler-rt/lib/tsan/rtl/tsan_libdispatch.cc --- a/compiler-rt/lib/tsan/rtl/tsan_libdispatch.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_libdispatch.cc @@ -322,9 +322,15 @@ return result; } +TSAN_INTERCEPTOR(void, dispatch_group_enter, dispatch_group_t group) { + SCOPED_TSAN_INTERCEPTOR(dispatch_group_enter, group); + Acquire(thr, pc, (uptr)group); + REAL(dispatch_group_enter)(group); +} + TSAN_INTERCEPTOR(void, dispatch_group_leave, dispatch_group_t group) { SCOPED_TSAN_INTERCEPTOR(dispatch_group_leave, group); - // Acquired in the group noticifaction callback in dispatch_group_notify[_f]. + // Acquired in the group notification callback in dispatch_group_notify[_f]. Release(thr, pc, (uptr)group); REAL(dispatch_group_leave)(group); } @@ -739,6 +745,7 @@ INTERCEPT_FUNCTION(dispatch_semaphore_signal); INTERCEPT_FUNCTION(dispatch_semaphore_wait); INTERCEPT_FUNCTION(dispatch_group_wait); + INTERCEPT_FUNCTION(dispatch_group_enter); INTERCEPT_FUNCTION(dispatch_group_leave); INTERCEPT_FUNCTION(dispatch_group_async); INTERCEPT_FUNCTION(dispatch_group_async_f);