Adds new OS internal functions nxsig_sleep() and nxsig_usleep. These differ from the standard sleep() and usleep() in that (1) they don't cause cancellation points, and (2) don't set the errno variable (if applicable). All calls to sleep() and usleep() changed to calls to nxsig_sleep() and nxsig_usleep().

Squashed commit of the following:

    Change all calls to usleep() in the OS proper to calls to nxsig_usleep()

    sched/signal:  Add a new OS internal function nxsig_usleep() that is functionally equivalent to usleep() but does not cause a cancellaption point and does not modify the errno variable.

    sched/signal:  Add a new OS internal function nxsig_sleep() that is functionally equivalent to sleep() but does not cause a cancellaption point.
This commit is contained in:
Gregory Nutt
2017-10-06 10:15:01 -06:00
parent fdd0dcc0b6
commit 936df1bcb5
85 changed files with 569 additions and 189 deletions
+3 -3
View File
@@ -49,6 +49,7 @@
#include <debug.h>
#include <nuttx/arch.h>
#include <nuttx/signal.h>
#include <nuttx/page.h>
#include <nuttx/clock.h>
@@ -538,15 +539,14 @@ int pg_worker(int argc, char *argv[])
{
/* Wait awhile. We will wait here until either the configurable timeout
* elapses or until we are awakened by a signal (which terminates the
* usleep with an EINTR error). Note that interrupts will be re-enabled
* while this task sleeps.
* nxsig_usleep with an EINTR error). Note that interrupts will be re- * enabled while this task sleeps.
*
* The timeout is a failsafe that will handle any cases where a single
* is lost (that would really be a bug and shouldn't happen!) and also
* supports timeouts for case of non-blocking, asynchronous fills.
*/
usleep(CONFIG_PAGING_WORKPERIOD);
nxsig_usleep(CONFIG_PAGING_WORKPERIOD);
/* The page fill worker thread will be awakened on one of three conditions:
*