MINOR: tools/rnd: compute the result outside of the CAS loop
authorWilly Tarreau <w@1wt.eu>
Sun, 9 May 2021 08:26:14 +0000 (10:26 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 9 May 2021 08:26:14 +0000 (10:26 +0200)
commitb2475a139e69ba7792054233faee946be7f83ca9
tree4aa7ba7cdb13239fd1845e757b8f5d24c19b7b5a
parent714f34580ed31a2fd0604b2bfe2694d15aa04caf
MINOR: tools/rnd: compute the result outside of the CAS loop

ha_random64() uses a DWCAS loop to produce the random, but it computes
the resulting value inside the loop while it doesn't change upon success,
so this is a needless overhead inside the critcal path that participates
to making threads fail the race and try again. Let's take the value out
of the loop.
src/tools.c