mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
mq_receive/send: Return appropriate errnos and stop waiting if signal received.
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@164 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
+3
-1
@@ -156,11 +156,13 @@ int sem_wait(sem_t *sem)
|
||||
|
||||
/* Add the TCB to the prioritized semaphore wait queue */
|
||||
|
||||
*get_errno_ptr() = 0;
|
||||
up_block_task(rtcb, TSTATE_WAIT_SEM);
|
||||
|
||||
/* When we resume at this point, either (1) the semaphore has been
|
||||
* assigned to this thread of execution, or (2) the semaphore wait
|
||||
* has been interrupted by a signal.
|
||||
* has been interrupted by a signal. We can detect the latter case
|
||||
* be examining the errno value.
|
||||
*/
|
||||
|
||||
if (*get_errno_ptr() != EINTR)
|
||||
|
||||
Reference in New Issue
Block a user