From 56580875abce106ce53882c38bc42767936b0ddc Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 1 Aug 2012 17:47:54 +0000 Subject: [PATCH] atexit() and on_exit() may now be configured to support multiple exit callbacks git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4995 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog | 3 + Documentation/NuttxPortingGuide.html | 18 ++ Documentation/NuttxUserGuide.html | 271 ++++++++++++++++++++++++++- TODO | 12 +- arch/arm/src/lpc17xx/lpc17_lowputc.c | 6 +- arch/arm/src/lpc17xx/lpc17_serial.c | 4 +- include/nuttx/sched.h | 24 ++- include/sys/syscall.h | 11 +- sched/atexit.c | 88 ++++++--- sched/on_exit.c | 92 ++++++--- sched/task_exithook.c | 203 +++++++++++++++----- syscall/stub_lookup.h | 4 + syscall/syscall.csv | 1 + 13 files changed, 617 insertions(+), 120 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3684728eb0..3dc1dc5270 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3096,4 +3096,7 @@ * arch/*/src/*_serial.c: Fix ioctl method return values. Theses methods should return a negated errno value; they should not set the errno variable. + * sched/on_exit.c, sched/task_exithook.c, and include/nuttx/sched.c: Add + support for multiple registered on_exit() functions if CONFIG_SCHED_ONEXIT_MAX + is defined. diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html index d3689da49f..c4a6c90a76 100644 --- a/Documentation/NuttxPortingGuide.html +++ b/Documentation/NuttxPortingGuide.html @@ -4063,6 +4063,24 @@ build CONFIG_SIG_SIGWORK: The signal number that will be used to wake-up the worker thread. Default: 4 + +
  • + CONFIG_SCHED_WAITPID: Enables the waitpid() API +
  • +
  • + CONFIG_SCHED_ATEXIT: Enables the atexit() API +
  • +
  • + CONFIG_SCHED_ATEXIT_MAX: By default if CONFIG_SCHED_ATEXIT is selected, only a single atexit() function is supported. + That number can be increased by defined this setting to the number that you require. +
  • +
  • + CONFIG_SCHED_ONEXIT: Enables the on_exit() API +
  • +
  • + CONFIG_SCHED_ONEXIT_MAX: By default if CONFIG_SCHED_ONEXIT is selected, only a single on_exit() function is supported. + That number can be increased by defined this setting to the number that you require. +
  • diff --git a/Documentation/NuttxUserGuide.html b/Documentation/NuttxUserGuide.html index 9d3af1c270..457347727c 100644 --- a/Documentation/NuttxUserGuide.html +++ b/Documentation/NuttxUserGuide.html @@ -13,7 +13,7 @@

    NuttX Operating System

    User's Manual

    by

    Gregory Nutt

    -

    Last Updated: March 23, 2012

    +

    Last Updated: August 1, 2012

    @@ -54,7 +54,7 @@