Commit Graph

5 Commits

Author SHA1 Message Date
Julian Lettner
e1b82d852d Remove dlsym() lookup for TSan functions from common path (#36478)
* Move TSan function lookup out of the common path

Move TSan function lookup via `dlsym()` out of the common path.  The
TSan runtime will now call `__tsan_on_initialize()` which we can use to
initialize the TSan functions in the Swift runtime.

This avoids paying the cost of `dlsym()` in the common, non-TSan case.

Depends on: https://reviews.llvm.org/D98810

rdar://75493372

* Remove Windows code

Thread Sanitizer is not supported on Windows.

Co-authored-by: Julian Lettner <julian.lettner@apple.com>
2021-04-06 09:16:47 -07:00
Julian Lettner
8abf12fbe6 Add swift_task_set_tsan_hooks()
This change will be sequenced:
  1. Call this hook from the TSan runtime
  2. Remove `dlsym()` lookup from Swift runtime
2021-03-16 13:43:55 -07:00
Julian Lettner
99bcd87af6 Use swift_once instead of C++ static initializers 2021-03-12 14:52:56 -08:00
Julian Lettner
ea5bb777e2 Fix TSan symbol lookup on Windows 2021-03-01 16:08:34 -08:00
Julian Lettner
5187382f25 Add support for calling TSan's acquire()/release() 2021-03-01 13:35:03 -08:00