-
uint32_t eventq_dequeue(eventq* queue, eventq_cqe* events, uint32_t count, uint32_t wait_time) {
int result;
if (wait_time != UINT32_MAX) {
struct __kernel_timespec timeout;
timeout.tv_sec += (wait_time / 1000);
timeout.tv_nsec += ((wait_time % 1000) * 1000000);
printf("eventq_dequeue, waiting %u ms\n", wait_time);
result = io_uring_wait_cqe_timeout(queue, events, &timeout);
} else {
printf("eventq_dequeue, waiting\n");
result = io_uring_wait_cqe(queue, events);
}
printf("eventq_dequeue, %d\n", result);
return result == 0 ? 1 : 0;
} Full code: https://github.com/nibanks/eventq/blob/main/eventq.h#L224 The function above is supposed to wait up to
Do I have an incorrect understanding of |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Ok. Apparently today is not my day. Yet another blunder on my part. The |
Beta Was this translation helpful? Give feedback.
Ok. Apparently today is not my day. Yet another blunder on my part. The
+=
above was copied from somewhere, and it should be simply=
. Now it works as expected. Sorry for the noise.