git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 7039760) | patch
Micro optimize LWLockAttemptLock() a bit.
2015年7月31日 18:50:35 +0000 (20:50 +0200)
Sun, 2 Aug 2015 16:41:23 +0000 (18:41 +0200)
commit a4b09af3e93707351f1d4b8efafabfa135c0f70b
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
src/backend/storage/lmgr/lwlock.c diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /