messaging3: Add messaging_read_send/recv
authorVolker Lendecke <vl@samba.org>
Mon, 30 Dec 2013 10:26:52 +0000 (11:26 +0100)
committerVolker Lendecke <vl@samba.org>
Tue, 21 Jan 2014 07:10:41 +0000 (08:10 +0100)
commit5f3ccfc16b7c64d2de109ba26d92d22ae1010882
treeff43659880bca36e4a0a33aef2a85bcc66a4abdd
parenteee450fec2f7cb5f45c47162fd5b7c0717978598
messaging3: Add messaging_read_send/recv

This is made to replace the msg_channel abstraction.

msg_channel was created to not miss any messages. For this, some
complex queueing was installed. This complexity has caused quite a
few problems in the past (see bug 10284 for example).

messaging_read_send/recv is able to achieve the same goal with a
lot less complexity. The messaging_read_send atomically installs
the reader into the messaging_context, we will not miss any messages
while this installed. messaging_send_recv will deinstall that
listener, but in the callback function you can directly call
messaging_read_send again without going through the tevent_loop_once.
As long as this is always made sure, no messages will be lost.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/include/messages.h
source3/lib/dbwrap/dbwrap_watch.c
source3/lib/messages.c