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

Unified Diff: base/threading/platform_thread_posix.cc

Issue 8965072: Add function support for Sleep and MessageLoop with TimeDelta input. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add TimeDelay interfaces for message loop code. Created 9 years 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
Index: base/threading/platform_thread_posix.cc
diff --git a/base/threading/platform_thread_posix.cc b/base/threading/platform_thread_posix.cc
index ea1f037725259ea890d88ea24c7b8ec0ab340628..a873efc2ba6c3d2e6267243f1e134a3b7f84acfd 100644
--- a/base/threading/platform_thread_posix.cc
+++ b/base/threading/platform_thread_posix.cc
@@ -165,6 +165,13 @@ void PlatformThread::Sleep(int duration_ms) {
sleep_time = remaining;
}
+// static
+void PlatformThread::Sleep(TimeDelta duration) {
+ // NOTE: This function is intended to supplant the other version of Sleep
+ // in the future. See issue 108171 for more information.
+ Sleep(duration.InMillisecondsRoundedUp());
brettw 2011/12/28 20:10:27 It seems like this is backwards. Sleep(ms) should
+}
+
#if defined(OS_LINUX)
// static
void PlatformThread::SetName(const char* name) {

Powered by Google App Engine
This is Rietveld 408576698