Difference between revisions of "Truxton message get queue is empty"
Jump to navigation
Jump to search
(Created page with "Tells you if your message queue is empty. =Syntax= <syntaxhighlight lang="C"> uint32_t truxton_message_get_queue_is_empty( uint64_t message_handle ); </syntaxhighlight> =Par...") |
|||
| Line 9: | Line 9: | ||
==<code>message_handle</code>== | ==<code>message_handle</code>== | ||
The handle to a message created by the [[truxton_message_create]] call. | The handle to a message created by the [[truxton_message_create]] call. | ||
| + | |||
| + | =Return value= | ||
| + | If the message queue doesn't contain any messages, the return value will be 1, otherwise it will be zero. | ||
=Sample= | =Sample= | ||
<syntaxhighlight lang="C" highlight="7"> | <syntaxhighlight lang="C" highlight="7"> | ||
| − | void | + | void check_message(uint64_t message) |
{ | { | ||
| − | + | if ( truxton_message_queue_is_empty( message ) == 0 ) | |
| − | + | { | |
| − | + | printf( "We should proceed\n" ); | |
| − | + | } | |
| − | + | else | |
| + | { | ||
| + | printf( "Queue is empty, we should sleep or exit\n" ); | ||
| + | } | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 04:33, 13 June 2020
Tells you if your message queue is empty.
Syntax
uint32_t truxton_message_get_queue_is_empty( uint64_t message_handle );
Parameters
message_handle
The handle to a message created by the truxton_message_create call.
Return value
If the message queue doesn't contain any messages, the return value will be 1, otherwise it will be zero.
Sample
void check_message(uint64_t message)
{
if ( truxton_message_queue_is_empty( message ) == 0 )
{
printf( "We should proceed\n" );
}
else
{
printf( "Queue is empty, we should sleep or exit\n" );
}
}