Disable iothread pool wait-around under TSan

The iothread pool has a feature where, if the thread is emptied, some
threads will choose to wait around in case new work appears, up to a
certain amount of time (500 msec). This prevents thrashing where new
threads are rapidly created and destroyed as the user types. This is
implemented via `std::condition_variable::wait_for`. However this function
is not properly instrumented under Thread Sanitizer (see
https://github.com/google/sanitizers/issues/1259) so TSan reports false
positives. Just disable this feature under TSan.
This commit is contained in:
ridiculousfish
2021-02-06 22:05:43 -08:00
parent a942df3886
commit ced56d492f
2 changed files with 22 additions and 3 deletions

View File

@@ -17,11 +17,11 @@
// block) and use select() to poll it.
#if defined(__has_feature)
#if __has_feature(thread_sanitizer)
#define TOPIC_MONITOR_TSAN_WORKAROUND
#define TOPIC_MONITOR_TSAN_WORKAROUND 1
#endif
#endif
#ifdef __SANITIZE_THREAD__
#define TOPIC_MONITOR_TSAN_WORKAROUND
#define TOPIC_MONITOR_TSAN_WORKAROUND 1
#endif
wcstring generation_list_t::describe() const {