2015-10-03 01:43:18 +02:00
|
|
|
/****************************************************************************
|
2014-08-08 20:31:23 +02:00
|
|
|
* sched/mqueue/mq_release.c
|
2013-02-04 17:55:38 +01:00
|
|
|
*
|
2020-03-10 16:26:30 +01:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2013-02-04 17:55:38 +01:00
|
|
|
*
|
2020-03-10 16:26:30 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2013-02-04 17:55:38 +01:00
|
|
|
*
|
2020-03-10 16:26:30 +01:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2013-02-04 17:55:38 +01:00
|
|
|
*
|
2015-10-03 01:43:18 +02:00
|
|
|
****************************************************************************/
|
2013-02-04 17:55:38 +01:00
|
|
|
|
2015-10-03 01:43:18 +02:00
|
|
|
/****************************************************************************
|
2013-02-04 17:55:38 +01:00
|
|
|
* Included Files
|
2015-10-03 01:43:18 +02:00
|
|
|
****************************************************************************/
|
2013-02-04 17:55:38 +01:00
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
2014-08-08 20:31:23 +02:00
|
|
|
#include "mqueue/mqueue.h"
|
2013-02-04 17:55:38 +01:00
|
|
|
|
2015-10-03 01:43:18 +02:00
|
|
|
/****************************************************************************
|
2013-02-04 17:55:38 +01:00
|
|
|
* Public Functions
|
2015-10-03 01:43:18 +02:00
|
|
|
****************************************************************************/
|
2013-02-04 17:55:38 +01:00
|
|
|
|
2015-10-03 01:43:18 +02:00
|
|
|
/****************************************************************************
|
2017-10-09 17:06:46 +02:00
|
|
|
* Name: nxmq_release
|
2013-02-04 17:55:38 +01:00
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* This function is called when the final member of a task group exits.
|
|
|
|
* This function closes all of the message queues opened by members of
|
|
|
|
* the task group.
|
|
|
|
*
|
2018-02-01 17:00:02 +01:00
|
|
|
* Input Parameters:
|
2013-02-04 17:55:38 +01:00
|
|
|
* group - The task group that is terminating.
|
|
|
|
*
|
2018-02-01 17:00:02 +01:00
|
|
|
* Returned Value:
|
2013-02-04 17:55:38 +01:00
|
|
|
* None
|
|
|
|
*
|
2015-10-03 01:43:18 +02:00
|
|
|
****************************************************************************/
|
2013-02-04 17:55:38 +01:00
|
|
|
|
2017-10-09 17:06:46 +02:00
|
|
|
void nxmq_release(FAR struct task_group_s *group)
|
2013-02-04 17:55:38 +01:00
|
|
|
{
|
|
|
|
while (group->tg_msgdesq.head)
|
|
|
|
{
|
2020-01-02 17:49:34 +01:00
|
|
|
nxmq_close_group((mqd_t)group->tg_msgdesq.head, group);
|
2013-02-04 17:55:38 +01:00
|
|
|
}
|
|
|
|
}
|