commit 73b479198d9e7e1cbdb2da705a0cd9226b0d8265
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date:   Mon Jan 30 20:56:35 2012 +0200

    Fix thinko in the group commit patch.
    
    When releasing a lwlock, if the first waiter in the queue waited for a
    shared lock, and all the rest were of the new "wait-until-free" kind, the
    releaseOK flag would not be cleared. That's harmless AFAICS, but it was
    not intended.

diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c
index bee35b8..eb9ff95 100644
--- a/src/backend/storage/lmgr/lwlock.c
+++ b/src/backend/storage/lmgr/lwlock.c
@@ -768,9 +768,9 @@ LWLockRelease(LWLockId lockid)
 				while (proc->lwWaitLink != NULL &&
 					   proc->lwWaitLink->lwWaitMode != LW_EXCLUSIVE)
 				{
-					proc = proc->lwWaitLink;
 					if (proc->lwWaitMode != LW_WAIT_UNTIL_FREE)
 						releaseOK = false;
+					proc = proc->lwWaitLink;
 				}
 			}
 			/* proc is now the last PGPROC to be released */
