1
0
mirror of https://github.com/azure-rtos/threadx synced 2025-01-30 08:02:57 +08:00

82 lines
4.8 KiB
C
Raw Normal View History

2020-11-10 13:25:20 -08:00
/**************************************************************************/
/* */
/* Copyright (c) Microsoft Corporation. All rights reserved. */
/* */
/* This software is licensed under the Microsoft Software License */
/* Terms for Microsoft Azure RTOS. Full text of the license can be */
/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
/* and in the root directory of this software. */
/* */
/**************************************************************************/
/**************************************************************************/
/**************************************************************************/
2021-06-02 06:45:05 +00:00
/** */
/** POSIX wrapper for THREADX */
2020-11-10 13:25:20 -08:00
/** */
/** */
/** */
/**************************************************************************/
/**************************************************************************/
2021-06-02 06:45:05 +00:00
/* Include necessary system files. */
#include "tx_api.h" /* Threadx API */
#include "pthread.h" /* Posix API */
#include "px_int.h" /* Posix helper functions */
2020-11-10 13:25:20 -08:00
/**************************************************************************/
/* */
/* FUNCTION RELEASE */
/* */
2021-06-02 06:45:05 +00:00
/* posix_putback_queue PORTABLE C */
2021-07-28 07:24:02 +00:00
/* 6.1.7 */
2020-11-10 13:25:20 -08:00
/* AUTHOR */
/* */
/* William E. Lamie, Microsoft Corporation */
/* */
/* DESCRIPTION */
/* */
2021-06-02 06:45:05 +00:00
/* This function "puts back" a ThreadX queue into the POSIX */
/* variable length message queue pool. */
2020-11-10 13:25:20 -08:00
/* */
/* INPUT */
/* */
2021-06-02 06:45:05 +00:00
/* qid Queue ID */
2020-11-10 13:25:20 -08:00
/* */
/* OUTPUT */
/* */
/* None */
/* */
/* CALLS */
/* */
2021-06-02 06:45:05 +00:00
/* posix_memory_putback Free memory */
2020-11-10 13:25:20 -08:00
/* */
/* CALLED BY */
/* */
2021-06-02 06:45:05 +00:00
/* POSIX internal Code */
2020-11-10 13:25:20 -08:00
/* */
/* RELEASE HISTORY */
/* */
/* DATE NAME DESCRIPTION */
/* */
2021-07-28 07:24:02 +00:00
/* 06-02-2021 William E. Lamie Initial Version 6.1.7 */
2020-11-10 13:25:20 -08:00
/* */
/**************************************************************************/
2021-06-02 06:45:05 +00:00
VOID posix_putback_queue(TX_QUEUE * qid)
{
POSIX_MSG_QUEUE * q_ptr;
2020-11-10 13:25:20 -08:00
2021-06-02 06:45:05 +00:00
/* Convert TX_QUEUE into POSIX_QUEUE datatype. */
q_ptr = MAKE_POSIX_QUEUE(qid);
2020-11-10 13:25:20 -08:00
2021-06-02 06:45:05 +00:00
/* Free the queue's memory. */
posix_memory_release(q_ptr->storage);
2020-11-10 13:25:20 -08:00
2021-06-02 06:45:05 +00:00
/* This queue is no longer in use. */
q_ptr->in_use = TX_FALSE;
return;
}