aboutsummaryrefslogtreecommitdiff
path: root/posix-aio-compat.c
diff options
context:
space:
mode:
authormalc <malc@c046a42c-6fe2-441c-8c8c-71466251a162>2009-02-21 05:48:19 +0000
committermalc <malc@c046a42c-6fe2-441c-8c8c-71466251a162>2009-02-21 05:48:19 +0000
commit514f7a277473a79fd42303f128379792a4667e65 (patch)
tree599e270a83ed526373632adc9baf0b89c6aeaccc /posix-aio-compat.c
parenta8227a5a200f1bb52ecd0f1a96b24d2e2dbf39f5 (diff)
downloadqemu-514f7a277473a79fd42303f128379792a4667e65.zip
qemu-514f7a277473a79fd42303f128379792a4667e65.tar.gz
qemu-514f7a277473a79fd42303f128379792a4667e65.tar.bz2
Properly handle pthread_cond_timedwait timing out
pthread_cond_timedwait is allowed to both consume the signal and return with the value indicating the timeout, hence predicate should always be (re)checked before taking an action git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6634 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'posix-aio-compat.c')
-rw-r--r--posix-aio-compat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/posix-aio-compat.c b/posix-aio-compat.c
index 1956917..6b547f4 100644
--- a/posix-aio-compat.c
+++ b/posix-aio-compat.c
@@ -104,7 +104,7 @@ static void *aio_thread(void *unused)
ret = cond_timedwait(&cond, &lock, &ts);
}
- if (ret == ETIMEDOUT)
+ if (TAILQ_EMPTY(&request_list))
break;
aiocb = TAILQ_FIRST(&request_list);