s3: Avoid a thundering herd in g_lock_unlock
authorVolker Lendecke <vl@samba.org>
Tue, 16 Feb 2010 11:22:08 +0000 (12:22 +0100)
committerMichael Adam <obnox@samba.org>
Wed, 10 Mar 2010 12:22:32 +0000 (13:22 +0100)
commitb880f85b3b5b74bf1a6404703ba7be762a7a3a0c
treea3913b0c08d04863052c85894f4a446997ec5f87
parent727b4838f4676a1edf137bae1620aa97725b8250
s3: Avoid a thundering herd in g_lock_unlock

Only notify the first 5 pending lock waiters. This avoids a thundering herd
problem that is really nasty in a cluster. It also makes acquiring a lock a bit
more FIFO, lock waiters are added to the end of the array.
source3/lib/g_lock.c