[tsan] Fix false positives with GCD dispatch_source_*

We already have interceptors for dispatch_source API (e.g. dispatch_source_set_event_handler), but they currently only handle submission synchronization. We also need to synchronize based on the target queue (serial, concurrent), in other words, we need to use dispatch_callback_wrap. This patch implements that.

Differential Revision: http://reviews.llvm.org/D21999



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@274619 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed