28 uint8_t msg_buf[
sizeof(uint8_t)];
49 "got free msg: %u", head->
id);
53 int16_t delay = 10 * (miu >> 1) * (miu >> 1);
55 struct timespec ts = {
57 .tv_nsec = 1000L * delay,
62 memset(&head->
u, 0,
sizeof(head->
u));
75 uint8_t msg_buf[
sizeof(uint8_t)];
79 if (reply_fd) { *reply_fd = msg->
pipes[0]; }
83 if (wr ==
sizeof(msg_buf)) {
91 "write_commit error, errno %d", errno);
115 "rx_info_max_used <- %d", head->
id);
121 "got free rx_info_t %d (%p)", head->
id, (
void *)head);
133 switch (info->
state) {
138 "find_info_by_sequence_id: info (%p) at +%d: <fd:%d, seq_id:%lld>",
139 (
void*)info, info->
id, fd, (
long long)seq_id);
140 if (info->
u.
hold.fd == fd && info->
u.
hold.seq_id == seq_id) {
148 "find_info_by_sequence_id: info (%p) at +%d [s %d]: box is %p",
149 (
void*)info, info->
id, info->
u.
expect.error, (
void*)box);
150 if (box != NULL && box->
out_seq_id == seq_id && box->
fd == fd) {
157 "match fail %d on line %d", info->
state, __LINE__);
164 "==== Could not find <fd:%d, seq_id:%lld>, dumping table ====\n",
165 fd, (
long long)seq_id);
#define MAX_QUEUE_MESSAGES
Max number of unprocessed queue messages.
Record in table for partially processed messages.
struct rx_info_t::@12::@13 hold
listener_msg * msg_freelist
A queue message, with a command in the tagged union.
bool ListenerHelper_PushMessage(struct listener *l, listener_msg *msg, int *reply_fd)
Push a message into the listener's message queue.
void * udata
User data for callbacks.
struct listener_msg * next
rx_info_t * rx_info_freelist
void ListenerTask_ReleaseMsg(struct listener *l, listener_msg *msg)
Release a message to the listener's message pool.
rx_info_t rx_info[(1024)]
uint16_t rx_info_max_used
#define BUS_LOG_SNPRINTF(B, LEVEL, EVENT_KEY, UDATA, MAX_SZ, FMT,...)
void ListenerTask_DumpRXInfoTable(listener *l)
Dump the RX info table.
struct rx_info_t::@12::@14 expect
rx_info_t * ListenerHelper_GetFreeRXInfo(struct listener *l)
Get a free RX_INFO record, if any are available.
#define ATOMIC_BOOL_COMPARE_AND_SWAP(PTR, OLD, NEW)
rx_info_t * ListenerHelper_FindInfoBySequenceID(listener *l, int fd, int64_t seq_id)
Try to find an RX_INFO record by a pair.
#define BUS_ASSERT(B, UDATA, COND)
ssize_t syscall_write(int fildes, const void *buf, size_t nbyte)
int fd
Destination filename and message body.
listener_msg * ListenerHelper_GetFreeMsg(listener *l)
Get a free message from the listener's message pool.
#define MAX_PENDING_MESSAGES
#define BUS_LOG(B, LEVEL, EVENT_KEY, MSG, UDATA)