diff options
author | 2020-08-26 21:41:13 -0700 | |
---|---|---|
committer | 2020-08-28 15:47:40 +0000 | |
commit | ca8343842f9094fd5eb86569d293250e783f582c (patch) | |
tree | c4e040eff9f8528626535106a88fe4e7bb317a00 /runtime/thread.cc | |
parent | 49a19f38c35605e675eee271691ed465802859bf (diff) |
Avoid NanoSleep overflow
NanoSleep with a very large argument could cause it to fail on 32 bits.
It doesn't appear to me that this was ever exposed to client code.
So this was probably not an observable bug.
Remove redundant uses of "constexpr inline" instead of adding another
one.
Bug: 161006928
Test: Treehugger
Change-Id: I2ad3b92d01c764915ab2aac17cc72ac5c6907ed4
Diffstat (limited to 'runtime/thread.cc')
-rw-r--r-- | runtime/thread.cc | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/runtime/thread.cc b/runtime/thread.cc index d1c87932da..55a7c28e15 100644 --- a/runtime/thread.cc +++ b/runtime/thread.cc @@ -46,12 +46,12 @@ #include "base/atomic.h" #include "base/bit_utils.h" #include "base/casts.h" -#include "arch/context.h" #include "base/file_utils.h" #include "base/memory_tool.h" #include "base/mutex.h" #include "base/stl_util.h" #include "base/systrace.h" +#include "base/time_utils.h" #include "base/timing_logger.h" #include "base/to_str.h" #include "base/utils.h" @@ -295,15 +295,6 @@ enum { kNoPermitWaiterWaiting = 2 }; -static inline time_t SaturatedTimeT(int64_t secs) { - if (sizeof(time_t) < sizeof(int64_t)) { - return static_cast<time_t>(std::min(secs, - static_cast<int64_t>(std::numeric_limits<time_t>::max()))); - } else { - return secs; - } -} - void Thread::Park(bool is_absolute, int64_t time) { DCHECK(this == Thread::Current()); #if ART_USE_FUTEXES |