diff options
author | Andres Freund <andres@anarazel.de> | 2015-07-31 20:50:35 +0200 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2015-08-02 18:41:41 +0200 |
commit | 9074e41dbd41bc45ef79aeac1b6496bf087509a7 (patch) | |
tree | 803f8e896e6c99e133e0aafbf1bce4a78dad2cdc /src/backend/access/transam/xlog.c | |
parent | 27b719173516b54df63a1bba4266798e9f77bbb9 (diff) |
Micro optimize LWLockAttemptLock() a bit.
LWLockAttemptLock pointlessly read the lock's state in every loop
iteration, even though pg_atomic_compare_exchange_u32() returns the old
value. Instead do that only once before the loop iteration.
Additionally there's no need to have the expected_state variable,
old_state mostly had the same value anyway.
Noticed-By: Heikki Linnakangas
Backpatch: 9.5, no reason to let the branches diverge at this point
Diffstat (limited to 'src/backend/access/transam/xlog.c')
0 files changed, 0 insertions, 0 deletions