Backed out changeset 18f02d991078 (bug 956899) for likely causing intermittent crashes in 13.3.0_7.js. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Sat, 28 May 2016 01:39:08 +0200
changeset 338412 764ab2ad75e784d0175f6645c1c2fca4816863af
parent 338411 3c86f1e4bbc95042068ec7b1e2246ab54239e1ce
child 338413 619ef5aac05fa3dadb656fac5352dc712451c109
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs956899
milestone49.0a1
backs out18f02d991078d01ae91f2b6c6ed1a6520143f2cd
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 18f02d991078 (bug 956899) for likely causing intermittent crashes in 13.3.0_7.js. r=backout
js/src/threading/ConditionVariable.h
js/src/threading/posix/ConditionVariable.cpp
js/src/threading/windows/ConditionVariable.cpp
--- a/js/src/threading/ConditionVariable.h
+++ b/js/src/threading/ConditionVariable.h
@@ -32,71 +32,45 @@ enum class CVStatus {
 class ConditionVariable
 {
 public:
   struct PlatformData;
 
   ConditionVariable();
   ~ConditionVariable();
 
-  // Wake one thread that is waiting on this condition.
   void notify_one();
-
-  // Wake all threads that are waiting on this condition.
   void notify_all();
 
-  // Block the current thread of execution until this condition variable is
-  // woken from another thread via notify_one or notify_all.
   void wait(UniqueLock<Mutex>& lock);
 
-  // As with |wait|, block the current thread of execution until woken from
-  // another thread. This method will resume waiting once woken until the given
-  // Predicate |pred| evaluates to true.
   template <typename Predicate>
   void wait(UniqueLock<Mutex>& lock, Predicate pred) {
     while (!pred()) {
       wait(lock);
     }
   }
 
-  // Block the current thread of execution until woken from another thread, or
-  // the given absolute time is reached. The given absolute time is evaluated
-  // when this method is called, so will wake up after (abs_time - now),
-  // independent of system clock changes. While insulated from clock changes,
-  // this API is succeptible to the issues discussed above wait_for.
   CVStatus wait_until(UniqueLock<Mutex>& lock,
                       const mozilla::TimeStamp& abs_time);
 
-  // As with |wait_until|, block the current thread of execution until woken
-  // from another thread, or the given absolute time is reached. This method
-  // will resume waiting once woken until the given Predicate |pred| evaluates
-  // to true.
   template <typename Predicate>
   bool wait_until(UniqueLock<Mutex>& lock, const mozilla::TimeStamp& abs_time,
                   Predicate pred) {
     while (!pred()) {
       if (wait_until(lock, abs_time) == CVStatus::Timeout) {
         return pred();
       }
     }
     return true;
   }
 
-  // Block the current thread of execution until woken from another thread, or
-  // the given time duration has elapsed. Given that the system may be
-  // interrupted between the callee and the actual wait beginning, this call
-  // has a minimum granularity of the system's scheduling interval, and may
-  // encounter substantially longer delays, depending on system load.
   CVStatus wait_for(UniqueLock<Mutex>& lock,
                     const mozilla::TimeDuration& rel_time);
 
-  // As with |wait_for|, block the current thread of execution until woken from
-  // another thread or the given time duration has elapsed. This method will
-  // resume waiting once woken until the given Predicate |pred| evaluates to
-  // true.
   template <typename Predicate>
   bool wait_for(UniqueLock<Mutex>& lock, const mozilla::TimeDuration& rel_time,
                 Predicate pred) {
     return wait_until(lock, mozilla::TimeStamp::Now() + rel_time,
                       mozilla::Move(pred));
   }
 
 
--- a/js/src/threading/posix/ConditionVariable.cpp
+++ b/js/src/threading/posix/ConditionVariable.cpp
@@ -124,21 +124,16 @@ js::ConditionVariable::wait_until(Unique
 {
   return wait_for(lock, abs_time - TimeStamp::Now());
 }
 
 js::CVStatus
 js::ConditionVariable::wait_for(UniqueLock<Mutex>& lock,
                                 const TimeDuration& a_rel_time)
 {
-  if (a_rel_time == TimeDuration::Forever()) {
-    wait(lock);
-    return CVStatus::NoTimeout;
-  }
-
   pthread_cond_t* ptCond = &platformData()->ptCond;
   pthread_mutex_t* ptMutex = &lock.lock.platformData()->ptMutex;
   int r;
 
   // Clamp to 0, as time_t is unsigned.
   TimeDuration rel_time = a_rel_time < TimeDuration::FromSeconds(0)
                           ? TimeDuration::FromSeconds(0)
                           : a_rel_time;
--- a/js/src/threading/windows/ConditionVariable.cpp
+++ b/js/src/threading/windows/ConditionVariable.cpp
@@ -376,22 +376,20 @@ js::ConditionVariable::wait_until(Unique
 
 js::CVStatus
 js::ConditionVariable::wait_for(UniqueLock<Mutex>& lock,
                                 const mozilla::TimeDuration& rel_time)
 {
   CRITICAL_SECTION* cs = &lock.lock.platformData()->criticalSection;
 
   // Note that DWORD is unsigned, so we have to be careful to clamp at 0.
-  // If rel_time is Forever, then ToMilliseconds is +inf, which evaluates as
-  // greater than UINT32_MAX, resulting in the correct INFINITE wait.
   double msecd = rel_time.ToMilliseconds();
   DWORD msec = msecd < 0.0
                ? 0
-               : msecd > UINT32_MAX
+               : msecd > DBL_MAX
                  ? INFINITE
                  : static_cast<DWORD>(msecd);
 
   BOOL r;
   if (sNativeImports.supported())
     r = platformData()->native.wait(cs, msec);
   else
     r = platformData()->fallback.wait(cs, msec);