1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Fix aio_error thread-safety.

* sysdeps/pthread/aio_error.c: New file
* sysdeps/pthread/aio_misc.c: Remove optimistic comment about
synchronization.
This commit is contained in:
Samuel Thibault
2015-03-06 11:32:24 +01:00
parent 1597b7447a
commit 1cdf2ea1fa
3 changed files with 57 additions and 8 deletions

View File

@ -593,14 +593,6 @@ handle_fildes_io (void *arg)
/* Get the mutex. */
pthread_mutex_lock (&__aio_requests_mutex);
/* In theory we would need here a write memory barrier since the
callers test using aio_error() whether the request finished
and once this value != EINPROGRESS the field __return_value
must be committed to memory.
But since the pthread_mutex_lock call involves write memory
barriers as well it is not necessary. */
if (aiocbp->aiocb.__return_value == -1)
aiocbp->aiocb.__error_code = errno;
else