#include <ctl_api.h> void *ctl_message_queue_receive(CTL_MESSAGE_QUEUE_t *m, unsigned use_timeout, CTL_TIME_t timeout);
The function ctl_message_queue_receive returns the oldest message in the message queue pointed at by m. This function will block if no messages are available unless use_timeout is non-zero and the current time reaches the timeout value. If the timeout occured the function returns zero.
ctl_message_queue_receive is provided in every implementation of the CrossWorks tasking library.