mpd/src/thread
Christian Körner 8bbfb5cda1 thread/PosixCond: fix timed_wait
pthread_cond_timedwait() in PosixCond.hxx:timed_wait(PosixMutex...) returns
EINVAL, if ts.tv_nsec >= 1E9. In this case, it returns to early.

Find attached a patch which fixes this. I chose a compare-subtraction method
to keep ts.tv_nsec below 1E9.

Another option would be
ts.tv_sec += ts.tv_nsec / 1000000000;
ts.tv_nsec %= 1000000000;

But I guess this takes more time on some ARM processors, which don't support
hardware division.
2016-09-19 11:21:21 +02:00
..
Cond.hxx thread/{Mutex,Cond}: remove obsolete comments 2015-08-25 12:52:13 +02:00
CriticalSection.hxx thread/{Mutex,Cond}: relicense to BSD-2 2014-07-02 20:09:39 +02:00
Id.hxx update copyright year to 2016 2016-02-26 17:54:05 +01:00
Mutex.hxx thread/Mutex: add method ScopeLock::Unlock() 2016-05-02 23:32:44 +02:00
Name.hxx update copyright year to 2016 2016-02-26 17:54:05 +01:00
PosixCond.hxx thread/PosixCond: fix timed_wait 2016-09-19 11:21:21 +02:00
PosixMutex.hxx thread/Posix{Mutex,Cond}: use "constexpr" only with glibc 2015-08-25 12:46:12 +02:00
Slack.hxx update copyright year to 2016 2016-02-26 17:54:05 +01:00
Thread.cxx thread/Thread: throw std::system_error on error 2016-06-17 19:11:20 +02:00
Thread.hxx thread/Thread: throw std::system_error on error 2016-06-17 19:11:20 +02:00
Util.cxx thread/Util: throw exception on error 2016-09-04 15:15:11 +02:00
Util.hxx thread/Util: throw exception on error 2016-09-04 15:15:11 +02:00
WindowsCond.hxx thread/{Mutex,Cond}: relicense to BSD-2 2014-07-02 20:09:39 +02:00