| 2144 | } // namespace |
| 2145 | |
| 2146 | int64_t GetRandomSeed() { |
| 2147 | // The process-global seed generator to aims to avoid calling std::random_device |
| 2148 | // unless truly necessary (it can block on some systems, see ARROW-10287). |
| 2149 | static auto seed_gen = GetSeedGenerator(); |
| 2150 | static std::mutex seed_gen_mutex; |
| 2151 | |
| 2152 | std::lock_guard<std::mutex> lock(seed_gen_mutex); |
| 2153 | return static_cast<int64_t>(seed_gen()); |
| 2154 | } |
| 2155 | |
| 2156 | uint64_t GetThreadId() { |
| 2157 | uint64_t equiv{0}; |