summaryrefslogtreecommitdiffstats
path: root/base/threading/platform_thread_win.cc
diff options
context:
space:
mode:
authortedvessenes@gmail.com <tedvessenes@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-30 01:04:36 +0000
committertedvessenes@gmail.com <tedvessenes@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-30 01:04:36 +0000
commit76784292d9ca82be8da21583d1e323dff2e513bc (patch)
treed0c706ff1a85b293eefba812e5b40360cab6b2d6 /base/threading/platform_thread_win.cc
parent46adf7ff93ebbbfdaf6f8ad7b7253018f5cff3dc (diff)
downloadchromium_src-76784292d9ca82be8da21583d1e323dff2e513bc.zip
chromium_src-76784292d9ca82be8da21583d1e323dff2e513bc.tar.gz
chromium_src-76784292d9ca82be8da21583d1e323dff2e513bc.tar.bz2
Add function support for Sleep with TimeDelta input.
This is the first step of fixing issue 108171 (converting calls of Sleep() to use TimeDelta instead of ints in milliseconds). I checked platform_thread_unittests.cc for any tests explicitly for Sleep but found none, so I didn't add any for this interface. There will be a bit more implementation juggling here once the Sleep(int ms) interface is removed, but that's coming in a later CL. BUG=108171 TEST= Review URL: http://codereview.chromium.org/8965072 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116012 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/threading/platform_thread_win.cc')
-rw-r--r--base/threading/platform_thread_win.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/base/threading/platform_thread_win.cc b/base/threading/platform_thread_win.cc
index d4fda25..5cd96c1 100644
--- a/base/threading/platform_thread_win.cc
+++ b/base/threading/platform_thread_win.cc
@@ -114,6 +114,11 @@ void PlatformThread::Sleep(int duration_ms) {
}
// static
+void PlatformThread::Sleep(TimeDelta duration) {
+ ::Sleep(duration.InMillisecondsRoundedUp());
+}
+
+// static
void PlatformThread::SetName(const char* name) {
current_thread_name.Set(const_cast<char*>(name));
tracked_objects::ThreadData::InitializeThreadContext(name);