• Christian Körner's avatar
    thread/PosixCond: fix timed_wait · 8bbfb5cd
    Christian Körner authored
    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.
    8bbfb5cd
Name
Last commit
Last update
android Loading commit data...
doc Loading commit data...
m4 Loading commit data...
python/build Loading commit data...
scripts Loading commit data...
src Loading commit data...
systemd Loading commit data...
test Loading commit data...
win32 Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
COPYING Loading commit data...
INSTALL Loading commit data...
Makefile.am Loading commit data...
NEWS Loading commit data...
README.md Loading commit data...
autogen.sh Loading commit data...
configure.ac Loading commit data...
mpd.svg Loading commit data...
valgrind.suppressions Loading commit data...