TAILIEUCHUNG - Real-Time Embedded Multithreading Using ThreadX and MIPS- P19

Real-Time Embedded Multithreading Using ThreadX and MIPS- P19:Although the history of embedded systems is relatively short, 1 the advances and successes of this fi eld have been profound. Embedded systems are found in a vast array of applications such as consumer electronics, “ smart ” devices, communication equipment, automobiles, desktop computers, and medical equipment. | F-4 Appendix F Description This service deletes the specified message queue. All threads suspended waiting for a message from this queue are resumed and receive a TX_DELETED return status. WARNING It is the application s responsibility to manage the memory area associated with the queue which is available after this service completes. In addition the application must not use a deleted queue. Input Parameter queue_ptr Pointer to a previously created message queue s Control Block. Return Values TX_SUCCESS2 0X00 Successful message queue deletion. TX_QUEUE_ERROR 0X09 Invalid message queue pointer. TX_CALLER_ERROR 0x13 Invalid caller of this service. Allowed From Threads Preemption Possible Yes Example TX_QUEUE my_queue UINT status Delete entire message queue. Assume that the queue has already been created with a call to tx_queue_create. status tx_queue_delete my_queue If status equals TX_SUCCESS the message queue is deleted. 2This value is not affected by the TX_DISABLE_ERROR_CHECKING define that is used to disable API error checking. on to remove this watermark. Message Queue Services F-5 tx_queue_flush Empty all messages in a message queue Prototype UINT tx_queue_flush TX_QUEUE queue_ptr Description This service deletes all messages stored in the specified message queue. If the queue is full messages of all suspended threads are discarded. Each suspended thread is then resumed with a return status that indicates the message send was successful. If the queue is empty this service does nothing. This service may modify the Queue Control Block through the parameter queue_ptr. Input Parameter queue_ptr Pointer to a previously created message queue s Control Block. Return Values TX_SUCCESS3 0X00 Successful message queue flush. TX_QUEUE_ERROR 0X09 Invalid message queue pointer. TX_CALLER_ERROR 0x13 Invalid caller of this service. Allowed From Initialization threads timers and ISRs Preemption Possible Yes Example TX_QUEUE my_queue UINT status 3This value is .

TÀI LIỆU HOT