Move list of open message queues to task group. Now message queues opened by members of the group will be closed when the last member of the group exits.

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5609 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2013-02-04 16:55:38 +00:00
parent ce722fd1e3
commit 5475d02446
8 changed files with 164 additions and 42 deletions
+9 -4
View File
@@ -77,7 +77,7 @@
*/
#else
# if !defined(CONFIG_DISABLE_ENVIRON) /* Environment variales */
# if !defined(CONFIG_DISABLE_ENVIRON) /* Environment variables */
# define HAVE_TASK_GROUP 1
# elif defined(CONFIG_SCHED_ATEXIT) /* Group atexit() function */
# define HAVE_TASK_GROUP 1
@@ -91,6 +91,8 @@
# define HAVE_TASK_GROUP 1
# elif CONFIG_NSOCKET_DESCRIPTORS > 0 /* Sockets */
# define HAVE_TASK_GROUP 1
# elif !defined(CONFIG_DISABLE_MQUEUE) /* Message queues */
# define HAVE_TASK_GROUP 1
# endif
#endif
@@ -375,6 +377,11 @@ struct task_group_s
#if CONFIG_NSOCKET_DESCRIPTORS > 0
struct socketlist tg_socketlist; /* Maps socket descriptor to socket */
#endif
/* POSIX Named Message Queue Fields *******************************************/
#ifndef CONFIG_DISABLE_MQUEUE
sq_queue_t tg_msgdesq; /* List of opened message queues */
#endif
};
#endif
@@ -488,13 +495,12 @@ struct _TCB
/* POSIX Named Message Queue Fields *******************************************/
#ifndef CONFIG_DISABLE_MQUEUE
sq_queue_t msgdesq; /* List of opened message queues */
FAR msgq_t *msgwaitq; /* Waiting for this message queue */
#endif
/* Library related fields *****************************************************/
int pterrno; /* Current per-thread errno */
int pterrno; /* Current per-thread errno */
/* State save areas ***********************************************************/
/* The form and content of these fields are processor-specific. */
@@ -504,7 +510,6 @@ struct _TCB
#if CONFIG_TASK_NAME_SIZE > 0
char name[CONFIG_TASK_NAME_SIZE]; /* Task name */
#endif
};
/* Certain other header files may also define this time to avoid circular header