mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
Move waitpid() data structures to task group; The caller of waitpid() is now only awakened when the final thread of the task group exits
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5608 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
+10
-5
@@ -83,6 +83,8 @@
|
||||
# define HAVE_TASK_GROUP 1
|
||||
# elif defined(CONFIG_SCHED_ONEXIT) /* Group on_exit() function */
|
||||
# define HAVE_TASK_GROUP 1
|
||||
# elif defined(CONFIG_SCHED_WAITPID) /* Group waitpid() function */
|
||||
# define HAVE_TASK_GROUP 1
|
||||
# elif CONFIG_NFILE_DESCRIPTORS > 0 /* File descriptors */
|
||||
# define HAVE_TASK_GROUP 1
|
||||
# elif CONFIG_NFILE_STREAMS > 0 /* Standard C buffered I/O */
|
||||
@@ -326,6 +328,14 @@ struct task_group_s
|
||||
FAR struct child_status_s *tg_children; /* Head of a list of child status */
|
||||
#endif
|
||||
|
||||
/* waitpid support ************************************************************/
|
||||
/* Simple mechanism used only when there is no support for SIGCHLD */
|
||||
|
||||
#if defined(CONFIG_SCHED_WAITPID) && !defined(CONFIG_SCHED_HAVE_PARENT)
|
||||
sem_t tg_exitsem; /* Support for waitpid */
|
||||
int *tg_statloc; /* Location to return exit status */
|
||||
#endif
|
||||
|
||||
/* Pthreads *******************************************************************/
|
||||
|
||||
#ifndef CONFIG_DISABLE_PTHREAD
|
||||
@@ -408,11 +418,6 @@ struct _TCB
|
||||
FAR void *starthookarg; /* The argument passed to the function */
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SCHED_WAITPID) && !defined(CONFIG_SCHED_HAVE_PARENT)
|
||||
sem_t exitsem; /* Support for waitpid */
|
||||
int *stat_loc; /* Location to return exit status */
|
||||
#endif
|
||||
|
||||
uint8_t sched_priority; /* Current priority of the thread */
|
||||
|
||||
#ifdef CONFIG_PRIORITY_INHERITANCE
|
||||
|
||||
Reference in New Issue
Block a user