From a0f567f4a30375b809224cdea87ed9b6b95786e5 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 9 Dec 2016 18:39:40 -0600 Subject: [PATCH] Update TODO, cosmetic changes, spelling -- US English spells it canceled and canceling vs cancelled and cancelling. No idea why. --- TODO | 30 ++++++++++++++-------------- fs/aio/aio_cancel.c | 22 ++++++++++---------- fs/aio/aio_read.c | 4 ++-- fs/aio/aio_write.c | 4 ++-- fs/mount/fs_automount.c | 2 +- sched/pthread/pthread_condwait.c | 6 +++++- sched/pthread/pthread_mutexdestroy.c | 4 ++-- 7 files changed, 38 insertions(+), 34 deletions(-) diff --git a/TODO b/TODO index 3dcfc0365f..e330d46a95 100644 --- a/TODO +++ b/TODO @@ -595,34 +595,34 @@ o pthreads (sched/pthreads) the following functions. There are some execptions as noted: accept() mq_timedsend() NA putpmsg() sigtimedwait() - -4 aio_suspend() NA msgrcv() pwrite() NA sigwait() + 04 aio_suspend() NA msgrcv() pwrite() NA sigwait() NA clock_nanosleep() NA msgsnd() read() sigwaitinfo() - close() NA msync() NA readv() -1 sleep() - connect() nanosleep() recv() -2 system() - OK creat() open() recvfrom() NA tcdrain() - fcntl() pause() NA recvmsg() -1 usleep() - NA fdatasync() poll() select() OK wait() + close() NA msync() NA readv() 01 sleep() + connect() nanosleep() recv() 02 system() + -- creat() open() recvfrom() NA tcdrain() + fcntl() pause() NA recvmsg() 01 usleep() + NA fdatasync() poll() select() -- wait() fsync() pread() sem_timedwait() waitid() NA getmsg() NA pselect() sem_wait() waitpid() NA getpmsg() pthread_cond_timedwait() send() write() NA lockf() pthread_cond_wait() NA sendmsg() NA writev() mq_receive() pthread_join() sendto() - mq_send() pthread_testcancel() -3 sigpause() + mq_send() pthread_testcancel() 03 sigpause() mq_timedreceive() NA putmsg() sigsuspend() - NA Not supported - OK Doesn't need instrumentation. Handled by lower level calls. - -n See note n + NA Not supported + -- Doesn't need instrumentation. Handled by lower level calls. + nn See note nn - NOTE 1: sleep() and usleep() are user-space functions in the C library and cannot + NOTE 01: sleep() and usleep() are user-space functions in the C library and cannot serve as cancellation points. They are, however, simple wrappers around nanosleep which is a true cancellation point. - NOTE 2: system() is actually implemented in apps/ as part of NSH. It cannot be + NOTE 02: system() is actually implemented in apps/ as part of NSH. It cannot be a cancellation point either. - NOTE 3: sigpause() is a user-space function in the C library and cannot serve as + NOTE 03: sigpause() is a user-space function in the C library and cannot serve as cancellation points. It is, however, a simple wrapper around sigsuspend() which is a true cancellation point. - NOTE 4: aio_suspend() is a user-space function in the C library and cannot serve as + NOTE 04: aio_suspend() is a user-space function in the C library and cannot serve as cancellation points. It does call around sigtimedwait() which is a true cancellation point. Status: Not really open. This is just the way it is. @@ -1530,7 +1530,7 @@ o Libraries (libc/, libm/) Description: There are many things implemented within the kernel (for example under sched/pthread) that probably should be migrated in the C library where it belongs. - Status: Open + Status: Ope Priority: Low o File system / Generic drivers (fs/, drivers/) diff --git a/fs/aio/aio_cancel.c b/fs/aio/aio_cancel.c index bdd4ba463a..aa575fdb8b 100644 --- a/fs/aio/aio_cancel.c +++ b/fs/aio/aio_cancel.c @@ -61,30 +61,30 @@ * The aio_cancel() function attempts to cancel one or more asynchronous * I/O requests currently outstanding against file descriptor 'fildes'. * The aiocbp argument points to the asynchronous I/O control block for - * a particular request to be cancelled. If aiocbp is NULL, then all + * a particular request to be canceled. If aiocbp is NULL, then all * outstanding cancelable asynchronous I/O requests against fildes will - * be cancelled. + * be canceled. * * Normal asynchronous notification will occur for asynchronous I/O - * operations that are successfully cancelled. If there are requests that - * cannot be cancelled, then the normal asynchronous completion process + * operations that are successfully canceled. If there are requests that + * cannot be canceled, then the normal asynchronous completion process * will take place for those requests when they are completed. * - * For requested operations that are successfully cancelled, the associated + * For requested operations that are successfully canceled, the associated * error status will be set to ECANCELED and the return status will be -1. - * For requested operations that are not successfully cancelled, the aiocbp + * For requested operations that are not successfully canceled, the aiocbp * will not be modified by aio_cancel(). * * Input Parameters: * fildes - Not used in this implementation * aiocbp - Points to the asynchronous I/O control block for a particular - * request to be cancelled. + * request to be canceled. * * Returned Value: * The aio_cancel() function will return the value AIO_CANCELED if the - * requested operation(s) were cancelled. The value AIO_NOTCANCELED will + * requested operation(s) were canceled. The value AIO_NOTCANCELED will * be returned if at least one of the requested operation(s) cannot be - * cancelled because it is in progress. In this case, the state of the + * canceled because it is in progress. In this case, the state of the * other operations, if any, referenced in the call to aio_cancel() is * not indicated by the return value of aio_cancel(). The application * may determine the state of affairs for these operations by using @@ -133,7 +133,7 @@ int aio_cancel(int fildes, FAR struct aiocb *aiocbp) * possibilities:* (1) the work has already been started and * is no longer queued, or (2) the work has not been started * and is still in the work queue. Only the second case can - * be cancelled. work_cancel() will return -ENOENT in the + * be canceled. work_cancel() will return -ENOENT in the * first case. */ @@ -177,7 +177,7 @@ int aio_cancel(int fildes, FAR struct aiocb *aiocbp) * possibilities:* (1) the work has already been started and * is no longer queued, or (2) the work has not been started * and is still in the work queue. Only the second case can - * be cancelled. work_cancel() will return -ENOENT in the + * be canceled. work_cancel() will return -ENOENT in the * first case. */ diff --git a/fs/aio/aio_read.c b/fs/aio/aio_read.c index 6d261ec7d8..462c5ddd26 100644 --- a/fs/aio/aio_read.c +++ b/fs/aio/aio_read.c @@ -226,7 +226,7 @@ static void aio_read_worker(FAR void *arg) * aiocbp->aio_nbytes is an invalid value. * * In the case that the aio_read() successfully queues the I/O operation - * but the operation is subsequently cancelled or encounters an error, the + * but the operation is subsequently canceled or encounters an error, the * return status of the asynchronous operation is one of the values * normally returned by the read() function call. In addition, the error * status of the asynchronous operation is set to one of the error @@ -235,7 +235,7 @@ static void aio_read_worker(FAR void *arg) * * EBADF - The aiocbp->aio_fildes argument is not a valid file descriptor * open for reading. - * ECANCELED - The requested I/O was cancelled before the I/O completed + * ECANCELED - The requested I/O was canceled before the I/O completed * due to an explicit aio_cancel() request. * EINVAL - The file offset value implied by aiocbp->aio_offset would be * invalid. diff --git a/fs/aio/aio_write.c b/fs/aio/aio_write.c index 3d20b2dd93..0aab19e7cb 100644 --- a/fs/aio/aio_write.c +++ b/fs/aio/aio_write.c @@ -279,7 +279,7 @@ errout: * aiocbp->aio_nbytes is an invalid value. * * In the case that the aio_write() successfully queues the I/O operation - * but the operation is subsequently cancelled or encounters an error, the + * but the operation is subsequently canceled or encounters an error, the * return status of the asynchronous operation is one of the values * normally returned by the write() function call. In addition, the error * status of the asynchronous operation is set to one of the error @@ -290,7 +290,7 @@ errout: * open for writing. * EINVAL - The file offset value implied by aiocbp->aio_offset would be * invalid. - * ECANCELED - The requested I/O was cancelled before the I/O completed + * ECANCELED - The requested I/O was canceled before the I/O completed * due to an explicit aio_cancel() request. * * The following condition may be detected synchronously or asynchronously: diff --git a/fs/mount/fs_automount.c b/fs/mount/fs_automount.c index 1bee61d7f5..47bc9c0118 100644 --- a/fs/mount/fs_automount.c +++ b/fs/mount/fs_automount.c @@ -485,7 +485,7 @@ static int automount_interrupt(FAR const struct automount_lower_s *lower, /* Queue work to occur after a delay. The delays performs debouncing: * If the insertion/removal detection logic has "chatter", then we may * receive this interrupt numerous times. Each time, the previous work - * will be cancelled (above) and the new work will scheduled with the + * will be canceled (above) and the new work will scheduled with the * delay. So the final mount operation will not be performed until the * insertion state is stable for that delay. */ diff --git a/sched/pthread/pthread_condwait.c b/sched/pthread/pthread_condwait.c index 631e6c2679..647313dc66 100644 --- a/sched/pthread/pthread_condwait.c +++ b/sched/pthread/pthread_condwait.c @@ -107,7 +107,11 @@ int pthread_cond_wait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex) ret |= pthread_takesemaphore((FAR sem_t *)&cond->sem); sched_unlock(); - /* Reacquire the mutex */ + /* Reacquire the mutex. + * + * REVISIT: When cancellation points are enabled, we will almost + * certainly hold the mutex when the pthread is canceled. + */ sinfo("Reacquire mutex...\n"); ret |= pthread_takesemaphore((FAR sem_t *)&mutex->sem); diff --git a/sched/pthread/pthread_mutexdestroy.c b/sched/pthread/pthread_mutexdestroy.c index bea9ba7c38..8bab62c474 100644 --- a/sched/pthread/pthread_mutexdestroy.c +++ b/sched/pthread/pthread_mutexdestroy.c @@ -75,7 +75,7 @@ int pthread_mutex_destroy(FAR pthread_mutex_t *mutex) sinfo("mutex=0x%p\n", mutex); - if (!mutex) + if (mutex == NULL) { ret = EINVAL; } @@ -100,7 +100,7 @@ int pthread_mutex_destroy(FAR pthread_mutex_t *mutex) ret = kill(mutex->pid, 0); if (ret < 0) { - /* That thread associated with the PID no longer exists */ + /* The thread associated with the PID no longer exists */ mutex->pid = -1;