casaroli commented on code in PR #21943:
URL: https://github.com/apache/nuttx/pull/21943#discussion_r4611628794


##########
fs/vfs/fs_epoll.c:
##########
@@ -1019,18 +1020,28 @@ int epoll_pwait(int epfd, FAR struct epoll_event *evs,
       goto out;
     }
 
+  /* Set the mask for the whole wait.  Without signals, there is no mask to
+   * set.  A pending signal that the mask unblocks stops the call at once.
+   * The critical section closes the window from this test to the wait.
+   */
+
+#ifndef CONFIG_DISABLE_ALL_SIGNALS
+  flags = enter_critical_section();

Review Comment:
   Signals are sent under `enter_critical_section()`, also from interrupt 
handlers (sched/signal/sig_dispatch.c:629). Without it, a signal that comes 
after the pending check and before `nxsem_wait()` does not stop the wait. 
`ppoll()`, `pselect()` and `sigsuspend()` use the same critical section 
(sig_ppoll.c:84, sig_pselect.c:81, sig_suspend.c:97).
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to