Skip to content

Commit

Permalink
amputate unused SleepForMilliseconds from sysinfo.{h,cc}
Browse files Browse the repository at this point in the history
  • Loading branch information
alk committed Feb 14, 2021
1 parent ac68c97 commit 01c2697
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
13 changes: 0 additions & 13 deletions src/base/sysinfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -242,19 +242,6 @@ bool GetUniquePathFromEnv(const char* env_name, char* path) {
return true;
}

void SleepForMilliseconds(int milliseconds) {
#ifdef PLATFORM_WINDOWS
_sleep(milliseconds); // Windows's _sleep takes milliseconds argument
#else
// Sleep for a few milliseconds
struct timespec sleep_time;
sleep_time.tv_sec = milliseconds / 1000;
sleep_time.tv_nsec = (milliseconds % 1000) * 1000000;
while (nanosleep(&sleep_time, &sleep_time) != 0 && errno == EINTR)
; // Ignore signals and wait for the full interval to elapse.
#endif
}

int GetSystemCPUsCount()
{
#if defined(PLATFORM_WINDOWS)
Expand Down
2 changes: 0 additions & 2 deletions src/base/sysinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ extern bool GetUniquePathFromEnv(const char* env_name, char* path);

extern int GetSystemCPUsCount();

void SleepForMilliseconds(int milliseconds);

// Return true if we're running POSIX (e.g., NPTL on Linux) threads,
// as opposed to a non-POSIX thread library. The thing that we care
// about is whether a thread's pid is the same as the thread that
Expand Down

0 comments on commit 01c2697

Please sign in to comment.