Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: mojo/edk/util/mutex_unittest.cc

Issue 1639093002: Add //mojo/edk/platform/thread_utils.* containing "yield" and "sleep". (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/edk/util/cond_var_unittest.cc ('k') | mojo/edk/util/waitable_event_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/util/mutex_unittest.cc
diff --git a/mojo/edk/util/mutex_unittest.cc b/mojo/edk/util/mutex_unittest.cc
index 3a69d416648214acb9fd635ace2e86e549c688f5..90656ca5844a98a56d58202933dc16c78de4426c 100644
--- a/mojo/edk/util/mutex_unittest.cc
+++ b/mojo/edk/util/mutex_unittest.cc
@@ -9,10 +9,12 @@
#include <thread>
#include "build/build_config.h"
-#include "mojo/edk/system/test/sleep.h"
+#include "mojo/edk/platform/thread_utils.h"
+#include "mojo/edk/system/test/timeouts.h"
#include "testing/gtest/include/gtest/gtest.h"
-using mojo::system::test::SleepMilliseconds;
+using mojo::platform::ThreadSleep;
+using mojo::system::test::DeadlineFromMilliseconds;
namespace mojo {
namespace util {
@@ -20,7 +22,7 @@ namespace {
// Sleeps for a "very small" amount of time.
void EpsilonRandomSleep() {
- SleepMilliseconds(static_cast<unsigned>(rand()) % 20u);
+ ThreadSleep(DeadlineFromMilliseconds(static_cast<unsigned>(rand()) % 20u));
}
// Basic test to make sure that Lock()/Unlock()/TryLock() don't crash ----------
« no previous file with comments | « mojo/edk/util/cond_var_unittest.cc ('k') | mojo/edk/util/waitable_event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698