Author: bonefish Date: 2011-06-08 01:58:23 +0200 (Wed, 08 Jun 2011) New Revision: 42028 Changeset: https://dev.haiku-os.org/changeset/42028 Modified: haiku/branches/developer/bonefish/signals/src/system/kernel/thread.cpp Log: _user_snooze_etc(): * No need to normalize the real-time flag and timebase. * For relative timeouts clear the real-time flag and set the timebase to system time, so wait time won't change when the real-time clock is set. Modified: haiku/branches/developer/bonefish/signals/src/system/kernel/thread.cpp =================================================================== --- haiku/branches/developer/bonefish/signals/src/system/kernel/thread.cpp 2011-06-07 23:46:50 UTC (rev 42027) +++ haiku/branches/developer/bonefish/signals/src/system/kernel/thread.cpp 2011-06-07 23:58:23 UTC (rev 42028) @@ -3437,13 +3437,6 @@ timebase = restartParameters->timebase; flags = restartParameters->flags; } else { - // If a real time time base is specified either way also set the other. - if ((flags & B_TIMEOUT_REAL_TIME_BASE) != 0 - && timebase == CLOCK_MONOTONIC) { - timebase = CLOCK_REALTIME; - } else if (timebase == CLOCK_REALTIME) - flags |= B_TIMEOUT_REAL_TIME_BASE; - // convert relative timeouts to absolute ones if ((flags & B_RELATIVE_TIMEOUT) != 0) { // not restarted yet and the flags indicate a relative timeout @@ -3459,6 +3452,12 @@ timeout = B_INFINITE_TIMEOUT; flags = (flags & ~B_RELATIVE_TIMEOUT) | B_ABSOLUTE_TIMEOUT; + + // Make sure we use the system time base, so real-time clock changes + // won't affect our wait. + flags &= ~(uint32)B_TIMEOUT_REAL_TIME_BASE; + if (timebase == CLOCK_REALTIME) + timebase = CLOCK_MONOTONIC; } else flags |= B_ABSOLUTE_TIMEOUT; }