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)
committerKarolin Seeger <kseeger@samba.org>
Wed, 31 Mar 2010 15:54:31 +0000 (17:54 +0200)
commit7e787c513e47875e7dbfc195d8bd1cecec3f08ce
tree094bd8d25f9be317674760628e00c42ee52d856b
parent9673c93933624ae6e02e83dae3c19351edfd301a
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.
(cherry picked from commit 725b3654f831fbe0388cc09f46269903c9eef1d7)
source3/lib/g_lock.c