diff --git a/include/nuttx/semaphore.h b/include/nuttx/semaphore.h index 33df1e01b77..03feb2c36fa 100644 --- a/include/nuttx/semaphore.h +++ b/include/nuttx/semaphore.h @@ -526,6 +526,12 @@ int sem_setprotocol(FAR sem_t *sem, int protocol); * EINVAL - Invalid attempt to get the semaphore * ECANCELED - May be returned if the thread is canceled while waiting. * + * NOTE: It is essential that callers of this function handle the + * ECANCELED error. Correct handling is that the function should return the + * error and the error should propagate back up the calling tree to the + * cancellation point interface function where the thread termination will + * be handled gracefully + * ****************************************************************************/ int nxsem_wait_uninterruptible(FAR sem_t *sem); @@ -551,6 +557,12 @@ int nxsem_wait_uninterruptible(FAR sem_t *sem); * EDEADLK A deadlock condition was detected. * ECANCELED May be returned if the thread is canceled while waiting. * + * NOTE: It is essential that callers of this function handle the + * ECANCELED error. Correct handling is that the function should return the + * error and the error should propagate back up the calling tree to the + * cancellation point interface function where the thread termination will + * be handled gracefully + * ****************************************************************************/ int nxsem_timedwait_uninterruptible(FAR sem_t *sem, @@ -581,6 +593,12 @@ int nxsem_timedwait_uninterruptible(FAR sem_t *sem, * -ETIMEDOUT is returned on the timeout condition. * -ECANCELED may be returned if the thread is canceled while waiting. * + * NOTE: It is essential that callers of this function handle the + * ECANCELED error. Correct handling is that the function should return the + * error and the error should propagate back up the calling tree to the + * cancellation point interface function where the thread termination will + * be handled gracefully + * ****************************************************************************/ int nxsem_tickwait_uninterruptible(FAR sem_t *sem, clock_t start,