Real-Time Embedded Multithreading: Using ThreadX and ARM

The message queue services described in this appendix include:
| tx_queue_create | Create a message queue |
| tx_queue_delete | Delete a message queue |
| tx_queue_flush | Empty all messages in a message queue |
| tx_queue_front_send | Send a message to the front of a message queue |
| tx_queue_info_get | Retrieve information about a message queue |
| tx_queue_prioritize | Prioritize a message queue suspension list |
| tx_queue_receive | Get a message from a message queue |
| tx_queue_send | Send a message to a message queue |
Create a message queue
UINT <b class="bold">tx_queue_create</b>(TX_QUEUE <b class="bold">*queue_ptr</b>, CHAR <b class="bold">*name_ptr</b>, UINT <b class="bold">message_size</b>, VOID <b class="bold">*queue_start</b>, ULONG <b class="bold">queue_size</b>)
This service creates a message queue that is typically used for inter-thread communication. This service calculates the total number of messages the queue can hold from the specified message size and the total number of bytes in the queue. This service initializes the Queue Control Block through the parameter queue_ptr.
| Note | If the total number of bytes specified in the queue s memory area is not evenly divisible by the specified message size, the remaining bytes in the memory area are not used. |
| queue_ptr | Pointer to a Message Queue Control Block. |
| name_ptr | Pointer to the name of the message queue. |
| message_size | Specifies the size of each message in the queue (in ULONGs). Message sizes range from 1... |