anchao commented on PR #17204:
URL: https://github.com/apache/nuttx/pull/17204#issuecomment-3413511087

   > One more question: if this replaces all the nxsig_sleep calls, doesn't 
that make the function obsolete? What's the use case for nxsig_sleep versus 
this new tick-based method?
   
   @linguini1 
   
   nxsig_sleep/usleep has the following two features:
   
   1. Supports the processing of signal sets.
   
https://github.com/apache/nuttx/blob/master/sched/signal/sig_timedwait.c#L98-L108
   2. Supports cancellation points.
   
https://github.com/apache/nuttx/blob/master/sched/signal/sig_timedwait.c#L275-L289
   
   Both of the above features are mandatory requirements of POSIX, so we cannot 
remove them.
   
   `nxsig_sleep/usleep` is the internal implementation of POSIX API 
`sleep/usleep`, and userspace needs to follow the semantics of POSIX.
   
   https://pubs.opengroup.org/onlinepubs/009696799/functions/sleep.html
   
   The sleep() function shall cause the calling thread to be suspended from 
execution until either the number of realtime seconds specified by the argument 
seconds has elapsed or **_a signal is delivered to the calling thread and its 
action is to invoke a signal-catching function or to terminate the process._**


-- 
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