Right now, TSan supports libdispatch only on Darwin, but the library is available on Linux as well (as part of the Swift project). Let's make TSan intercept the libdispatch APIs and support it on Linux.
The patch introduces a new build output on Linux, clang_rt.tsan_libdispatch-x86_64.a (for x86), which is an optional static library. The normal build of TSan is not changed, but if you use libdispatch for a project, you should link this optional library in. The patch also removes the build-time dependency on dispatch.h and manually declared the APIs that are used.
This comment is out-of-date. The file name is different now.