diff options
-rw-r--r-- | base/platform_thread.cc | 23 | ||||
-rw-r--r-- | base/platform_thread.h | 5 |
2 files changed, 0 insertions, 28 deletions
diff --git a/base/platform_thread.cc b/base/platform_thread.cc index 4b6c34f..6b24b3d 100644 --- a/base/platform_thread.cc +++ b/base/platform_thread.cc @@ -28,10 +28,8 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "base/platform_thread.h" -#include "base/time.h" #if defined(OS_POSIX) -#include <errno.h> #include <sched.h> #endif @@ -57,27 +55,6 @@ void PlatformThread::YieldCurrentThread() { #endif } -// static -void PlatformThread::Sleep(TimeDelta sleep_duration) { -#if defined(OS_WIN) - ::Sleep(static_cast<DWORD>(sleep_duration.InMilliseconds())); -#elif defined(OS_POSIX) - struct timespec sleep_time, remaining; - // Contains the portion of sleep_duration >= 1 sec. - sleep_time.tv_sec = sleep_duration.InSeconds(); - sleep_duration -= TimeDelta::FromSeconds(sleep_time.tv_sec); - // Contains the portion of sleep_duration < 1 sec. - sleep_time.tv_nsec = sleep_duration.InMicroseconds() * - Time::kNanosecondsPerMicrosecond; - while (nanosleep(&sleep_time, &remaining) == -1 && errno == EINTR) { - // Interrupted by a signal, we'll resume sleeping for the remainder of the - // original duration. - sleep_time = remaining; - } -#endif -} - - bool PlatformThread::operator==(const PlatformThread& other_thread) { #if defined(OS_WIN) return thread_ == other_thread.thread_; diff --git a/base/platform_thread.h b/base/platform_thread.h index 4b3cb39..2dca402 100644 --- a/base/platform_thread.h +++ b/base/platform_thread.h @@ -32,8 +32,6 @@ #include "build/build_config.h" -class TimeDelta; - #if defined(OS_WIN) #include <windows.h> @@ -53,9 +51,6 @@ class PlatformThread { // Yield the current thread so another thread can be scheduled. static void YieldCurrentThread(); - - // Sleep for the specified duration. - static void Sleep(TimeDelta sleep_duration); bool operator==(const PlatformThread& other_thread); |