mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
aio: fix newp->running data race
* sysdeps/pthread/aio_misc.c (__aio_enqueue_request): Do not write `running` field of `newp` when a thread was started to process it, since that thread will not take `__aio_requests_mutex`, and the field already has the proper value actually.
This commit is contained in:
@ -453,7 +453,11 @@ __aio_enqueue_request (aiocb_union *aiocbp, int operation)
|
||||
result = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
newp->running = running;
|
||||
}
|
||||
else
|
||||
newp->running = running;
|
||||
|
||||
/* Enqueue the request in the run queue if it is not yet running. */
|
||||
if (running == yes && result == 0)
|
||||
@ -466,9 +470,7 @@ __aio_enqueue_request (aiocb_union *aiocbp, int operation)
|
||||
pthread_cond_signal (&__aio_new_request_notification);
|
||||
}
|
||||
|
||||
if (result == 0)
|
||||
newp->running = running;
|
||||
else
|
||||
if (result != 0)
|
||||
{
|
||||
/* Something went wrong. */
|
||||
__aio_free_request (newp);
|
||||
|
Reference in New Issue
Block a user