diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2014-04-30 15:46:18 +0530 |
---|---|---|
committer | Will Newton <will.newton@linaro.org> | 2014-08-01 15:21:26 +0100 |
commit | 7f4fb31e61f2cb4080586f9de2d7338c0938b75c (patch) | |
tree | e7e676f8a15f1b156db4c7c196f0a30dd1c0cbf0 | |
parent | 2ba6ba153dca16d8c6ac9f4d857e3ba8ad639261 (diff) |
Fix lll_unlock twice in pthread_cond_broadcast
lll_unlock() will be called again if it goes to "wake_all" in
pthread_cond_broadcast(). This may make another thread which is
waiting for lock in pthread_cond_timedwait() unlock. So there are
more than one threads get the lock, it will break the shared data.
It's introduced by commit 8313cb997d2d("FUTEX_*_REQUEUE_PI support for
non-x86 code")
-rw-r--r-- | libc/ChangeLog.linaro | 5 | ||||
-rw-r--r-- | libc/nptl/pthread_cond_broadcast.c | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/libc/ChangeLog.linaro b/libc/ChangeLog.linaro index d901181ad..4dcd40984 100644 --- a/libc/ChangeLog.linaro +++ b/libc/ChangeLog.linaro @@ -1,3 +1,8 @@ +2014-04-30 Yang Yingliang <yangyingliang@huawei.com> + + * nptl/pthread_cond_broadcast.c (__pthread_cond_broadcast): + Return immediately after lll_futex_wake. + 2014-07-04 Will Newton <will.newton@linaro.org> * version.h: Bump version. diff --git a/libc/nptl/pthread_cond_broadcast.c b/libc/nptl/pthread_cond_broadcast.c index ed30e7c60..7c6c9ea9a 100644 --- a/libc/nptl/pthread_cond_broadcast.c +++ b/libc/nptl/pthread_cond_broadcast.c @@ -81,6 +81,7 @@ __pthread_cond_broadcast (cond) wake_all: lll_futex_wake (&cond->__data.__futex, INT_MAX, pshared); + return 0; } /* We are done. */ |