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>
Thu, 1 Apr 2010 07:39:18 +0000 (09:39 +0200)
commitbf348712cf2fa98c65e22393c1d6bc3edb5f1e10
tree8c7085084dea4b6f7fddba8eaf53fd190e41e53a
parent1c0797d25d0a2454f74963d0c7a973d84ddf793e
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)
(cherry picked from commit 7e787c513e47875e7dbfc195d8bd1cecec3f08ce)
source3/lib/g_lock.c