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 15:39:49 +0000 (16:39 +0100)
commitf373961ff38f0d9f6b7ef866b6cb30f653fc76b7
treea6dca4ba467210893116d2452b5e851aa7673d21
parente577980623ea64a852bac569bf50fb9c92d98b7b
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