OSDN Git Service

sem_timedwait with a null timeout doesn't mean "forever".
authorElliott Hughes <enh@google.com>
Wed, 16 Dec 2015 23:15:58 +0000 (15:15 -0800)
committerElliott Hughes <enh@google.com>
Wed, 16 Dec 2015 23:15:58 +0000 (15:15 -0800)
commitdd586f2ebd0c42904e699f3634568a38c97d4da7
tree9622cf03564998a33d69f2039382844d81384e30
parentd3e5301a75256171199b23f6ba2c6651d05ce5f1
sem_timedwait with a null timeout doesn't mean "forever".

It actually means "crash immediately". Well, it's an error. And callers are
much more likely to realize their mistake if we crash immediately rather
than return EINVAL. Historically, glibc has crashed and bionic -- before
the recent changes -- returned EINVAL, so this is a behavior change.

Change-Id: I0c2373a6703b20b8a97aacc1e66368a5885e8c51
libc/bionic/pthread_cond.cpp
libc/bionic/pthread_mutex.cpp
libc/bionic/pthread_rwlock.cpp
libc/bionic/semaphore.cpp
libc/private/bionic_time_conversions.h
tests/semaphore_test.cpp