s3-prefork: better timing out semantics
authorSimo Sorce <idra@samba.org>
Tue, 10 May 2011 13:08:21 +0000 (09:08 -0400)
committerAndreas Schneider <asn@samba.org>
Wed, 10 Aug 2011 16:14:04 +0000 (18:14 +0200)
commitb58d446c03f55203486fe7bb14f08b428efec6f3
tree1a7bb12d3bf72d4c277a6ff2e072dcd80acd1c1a
parentf6ae58f24256a339eec3b17699b10ab11482e6c1
s3-prefork: better timing out semantics

If this child has no clients, let the lock functions block for 1 second,
and then immediately reschedule the operation. This means we catch the lock
as soon as possible on a free child.

If, instead, we are already serving a client, we want to be non blocking,
so we timeout immediately on getting the lock, and then we sleep a 1/10th of
a second.
This means that a busy child will be slightly slower on picking up the lock,
but we won't block the existing client from communicating with us as we
immediately react to activity on the already opened file handler.

Signed-off-by: Andreas Schneider <asn@samba.org>
source3/lib/server_prefork.c