mirror of
https://github.com/haproxy/haproxy.git
synced 2026-02-20 00:10:41 -05:00
We frequently need to access a simple and fast PRNG for statistical purposes. The debug_prng() function did exactly this using a xorshift generator but its use was limited to debug only. Let's move this to tools.h and tools.c to make it accessible everywhere. Since it needs to be fast, its state is thread-local. An initialization function starts a different initial value for each thread for better distribution. |
||
|---|---|---|
| .. | ||
| haproxy | ||
| import | ||