struct msg_queue

Overview

Thread safe message queue for communication between Logger threads and listener server thread. More…

#include <logger_stream.h>

struct msg_queue {
    // fields

    refcnt_buffer_list items;
    bool shutdown;
    pthread_mutex_t mutex;
    int eventfd;
    GQueue* queue;
    GList* cache;
    bool offloaded;
    uint32_t offload_ts[2];
};

Detailed Documentation

Thread safe message queue for communication between Logger threads and listener server thread.

Structure storing a queue of regular log message pointers.

Fields

refcnt_buffer_list items

Messages

bool shutdown

Whether the queue is being shutdown

pthread_mutex_t mutex

Mutex for consumer-producer synchronization

int eventfd

File descriptor for consumer to poll on

GQueue* queue

Queue of message pointers stored in memory

GList* cache

A slot in queue after which the next message pointer could be added with high probability

bool offloaded

Whether some message pointers are offloaded to a file

uint32_t offload_ts[2]

Timestamp of the most recent message pointer offloaded to a file