summaryrefslogtreecommitdiffhomepage
path: root/test/util/save_util_linux.cc
diff options
context:
space:
mode:
authorDean Deng <deandeng@google.com>2020-10-16 14:30:19 -0700
committergVisor bot <gvisor-bot@google.com>2020-10-16 14:32:49 -0700
commit4ddb58f6efb3b0bfcce40f8d126973701db89c4b (patch)
tree4d9f4f2586b8c49a49bc9ba660c0d2efee188ea3 /test/util/save_util_linux.cc
parentdffa4c66909f034429e933f204cd49655c3e224f (diff)
Use POSIX interval timers in flock test.
ualarm(2) is obsolete. Move IntervalTimer into a test util, where it can be used by flock tests. These tests were flaky with TSAN, probably because it slowed the tests down enough that the alarm was expiring before flock() was called. Use an interval timer so that even if we miss the first alarm (or more), flock() is still guaranteed to be interrupted. PiperOrigin-RevId: 337578751
Diffstat (limited to 'test/util/save_util_linux.cc')
-rw-r--r--test/util/save_util_linux.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/util/save_util_linux.cc b/test/util/save_util_linux.cc
index d0aea8e6a..fbac94912 100644
--- a/test/util/save_util_linux.cc
+++ b/test/util/save_util_linux.cc
@@ -46,4 +46,4 @@ void MaybeSave() {
} // namespace testing
} // namespace gvisor
-#endif
+#endif // __linux__