From 89dbb28bd4c1f4240a84efedab75eebe083647b8 Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Tue, 24 Aug 2010 12:04:43 +0000 Subject: =?UTF-8?q?2010-09-24=09Ralf=20Cors=C3=A9pius=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * posix/src/aio_cancel.c: Spray pthread_mutex_unlocks. --- cpukit/posix/src/aio_cancel.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'cpukit/posix') diff --git a/cpukit/posix/src/aio_cancel.c b/cpukit/posix/src/aio_cancel.c index d9a982cf31..7006f793c7 100644 --- a/cpukit/posix/src/aio_cancel.c +++ b/cpukit/posix/src/aio_cancel.c @@ -45,9 +45,11 @@ int aio_cancel(int fildes, struct aiocb *aiocbp) if (aiocbp == NULL) { - if (fcntl (fildes, F_GETFL) < 0) + if (fcntl (fildes, F_GETFL) < 0) { + pthread_mutex_unlock(&aio_request_queue.mutex); rtems_set_errno_and_return_minus_one (EBADF); - + } + r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); @@ -58,8 +60,10 @@ int aio_cancel(int fildes, struct aiocb *aiocbp) r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); - if (r_chain == NULL) + if (r_chain == NULL) { + pthread_mutex_unlock(&aio_request_queue.mutex); return AIO_ALLDONE; + } rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); @@ -84,8 +88,7 @@ int aio_cancel(int fildes, struct aiocb *aiocbp) } else { - if (aiocbp->aio_fildes != fildes) - { + if (aiocbp->aio_fildes != fildes) { pthread_mutex_unlock (&aio_request_queue.mutex); rtems_set_errno_and_return_minus_one (EINVAL); } @@ -120,5 +123,4 @@ int aio_cancel(int fildes, struct aiocb *aiocbp) } return AIO_ALLDONE; - } -- cgit v1.2.3