|
World of Might and Magic
0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
|
Определения типов | |
| typedef struct AVThreadMessageQueue | AVThreadMessageQueue |
| typedef enum AVThreadMessageFlags | AVThreadMessageFlags |
Перечисления | |
| enum | AVThreadMessageFlags { AV_THREAD_MESSAGE_NONBLOCK = 1 } |
Функции | |
| int | av_thread_message_queue_alloc (AVThreadMessageQueue **mq, unsigned nelem, unsigned elsize) |
| void | av_thread_message_queue_free (AVThreadMessageQueue **mq) |
| int | av_thread_message_queue_send (AVThreadMessageQueue *mq, void *msg, unsigned flags) |
| int | av_thread_message_queue_recv (AVThreadMessageQueue *mq, void *msg, unsigned flags) |
| void | av_thread_message_queue_set_err_send (AVThreadMessageQueue *mq, int err) |
| void | av_thread_message_queue_set_err_recv (AVThreadMessageQueue *mq, int err) |
| void | av_thread_message_queue_set_free_func (AVThreadMessageQueue *mq, void(*free_func)(void *msg)) |
| int | av_thread_message_queue_nb_elems (AVThreadMessageQueue *mq) |
| void | av_thread_message_flush (AVThreadMessageQueue *mq) |
| typedef struct AVThreadMessageQueue AVThreadMessageQueue |
См. определение в файле threadmessage.h строка 22
| typedef enum AVThreadMessageFlags AVThreadMessageFlags |
| enum AVThreadMessageFlags |
См. определение в файле threadmessage.h строка 24
| int av_thread_message_queue_alloc | ( | AVThreadMessageQueue ** | mq, |
| unsigned | nelem, | ||
| unsigned | elsize | ||
| ) |
Allocate a new message queue.
| mq | pointer to the message queue |
| nelem | maximum number of elements in the queue |
| elsize | size of each element in the queue |
| void av_thread_message_queue_free | ( | AVThreadMessageQueue ** | mq | ) |
Free a message queue.
The message queue must no longer be in use by another thread.
| int av_thread_message_queue_send | ( | AVThreadMessageQueue * | mq, |
| void * | msg, | ||
| unsigned | flags | ||
| ) |
Send a message on the queue.
| int av_thread_message_queue_recv | ( | AVThreadMessageQueue * | mq, |
| void * | msg, | ||
| unsigned | flags | ||
| ) |
Receive a message from the queue.
| void av_thread_message_queue_set_err_send | ( | AVThreadMessageQueue * | mq, |
| int | err | ||
| ) |
Set the sending error code.
If the error code is set to non-zero, av_thread_message_queue_send() will return it immediately. Conventional values, such as AVERROR_EOF or AVERROR(EAGAIN), can be used to cause the sending thread to stop or suspend its operation.
| void av_thread_message_queue_set_err_recv | ( | AVThreadMessageQueue * | mq, |
| int | err | ||
| ) |
Set the receiving error code.
If the error code is set to non-zero, av_thread_message_queue_recv() will return it immediately when there are no longer available messages. Conventional values, such as AVERROR_EOF or AVERROR(EAGAIN), can be used to cause the receiving thread to stop or suspend its operation.
| void av_thread_message_queue_set_free_func | ( | AVThreadMessageQueue * | mq, |
| void(*)(void *msg) | free_func | ||
| ) |
Set the optional free message callback function which will be called if an operation is removing messages from the queue.
| int av_thread_message_queue_nb_elems | ( | AVThreadMessageQueue * | mq | ) |
Return the current number of messages in the queue.
| void av_thread_message_flush | ( | AVThreadMessageQueue * | mq | ) |
Flush the message queue
This function is mostly equivalent to reading and free-ing every message except that it will be done in a single operation (no lock/unlock between reads).