2020-06-16 21:39:45 +00:00
|
|
|
#include "webfuse_provider/impl/message_queue.h"
|
|
|
|
#include "webfuse_provider/impl/message.h"
|
2020-06-21 19:18:43 +00:00
|
|
|
#include "webfuse_provider/impl/util/container_of.h"
|
2019-03-26 22:04:53 +00:00
|
|
|
|
2020-06-16 21:57:41 +00:00
|
|
|
void wfp_message_queue_cleanup(
|
|
|
|
struct wfp_slist * queue)
|
2019-03-26 22:04:53 +00:00
|
|
|
{
|
2020-06-16 21:57:41 +00:00
|
|
|
struct wfp_slist_item * item = wfp_slist_first(queue);
|
2019-04-17 20:51:16 +00:00
|
|
|
while (NULL != item)
|
2019-03-26 22:04:53 +00:00
|
|
|
{
|
2020-06-16 21:57:41 +00:00
|
|
|
struct wfp_slist_item * next = item->next;
|
|
|
|
struct wfp_message * message = wfp_container_of(item, struct wfp_message, item);
|
|
|
|
wfp_message_dispose(message);
|
2019-04-17 20:51:16 +00:00
|
|
|
item = next;
|
2019-03-26 22:04:53 +00:00
|
|
|
}
|
2020-06-16 21:57:41 +00:00
|
|
|
wfp_slist_init(queue);
|
2019-03-26 22:04:53 +00:00
|
|
|
}
|