X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=libringbuffer%2Ffrontend_internal.h;h=1fb08dfdec90d3f25e5f7ce85f39c010386badf4;hb=49deb55988d873a8b8084ca75644b7d61c7a047c;hp=02cb4d4a75d37c4b70f1f515be7fe5a1e18443d9;hpb=950aab0c40f2e2c66aabe94a8b8a1b554b2b2c27;p=lttng-ust.git diff --git a/libringbuffer/frontend_internal.h b/libringbuffer/frontend_internal.h index 02cb4d4a..1fb08dfd 100644 --- a/libringbuffer/frontend_internal.h +++ b/libringbuffer/frontend_internal.h @@ -386,6 +386,20 @@ void lib_ring_buffer_check_deliver(const struct lib_ring_buffer_config *config, * Wake-up the other end by * writing a null byte in the * pipe (non-blocking). + * Important note: Because + * writing into the pipe is + * non-blocking (and therefore + * we allow dropping wakeup + * data, as long as there is + * wakeup data present in the + * pipe buffer to wake up the + * consumer), the consumer + * should perform the following + * sequence for waiting: + * 1) empty the pipe (reads). + * 2) check if there is data in + * the buffer. + * 3) wait on the pipe (poll). */ do { ret = write(wakeup_fd, "", 1);