diff options
Diffstat (limited to 'libsanitizer/tsan/tsan_flags.cc')
-rw-r--r-- | libsanitizer/tsan/tsan_flags.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libsanitizer/tsan/tsan_flags.cc b/libsanitizer/tsan/tsan_flags.cc index 1b726e6c8de..630bd75769b 100644 --- a/libsanitizer/tsan/tsan_flags.cc +++ b/libsanitizer/tsan/tsan_flags.cc @@ -56,6 +56,7 @@ void InitializeFlags(Flags *f, const char *env) { f->running_on_valgrind = false; f->external_symbolizer_path = ""; f->history_size = kGoMode ? 1 : 2; // There are a lot of goroutines in Go. + f->io_sync = 1; // Let a frontend override. OverrideFlags(f); @@ -81,6 +82,7 @@ void InitializeFlags(Flags *f, const char *env) { ParseFlag(env, &f->stop_on_start, "stop_on_start"); ParseFlag(env, &f->external_symbolizer_path, "external_symbolizer_path"); ParseFlag(env, &f->history_size, "history_size"); + ParseFlag(env, &f->io_sync, "io_sync"); if (!f->report_bugs) { f->report_thread_leaks = false; @@ -93,6 +95,12 @@ void InitializeFlags(Flags *f, const char *env) { " (must be [0..7])\n"); Die(); } + + if (f->io_sync < 0 || f->io_sync > 2) { + Printf("ThreadSanitizer: incorrect value for io_sync" + " (must be [0..2])\n"); + Die(); + } } } // namespace __tsan |