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)
committerVolker Lendecke <vl@samba.org>
Tue, 16 Feb 2010 12:21:10 +0000 (13:21 +0100)
commit725b3654f831fbe0388cc09f46269903c9eef1d7
tree0935e8d4d3246292bcf7cd4b1453bebb23e4f3a8
parent07978bd175395e0dc770f68fff5b8bd8b0fdeb51
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