MCPcopy Create free account
hub / github.com/apache/brpc / UpdateTLSRandom64

Function UpdateTLSRandom64

src/brpc/span.cpp:160–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158static __thread IdGen tls_span_id_gen = { false, 0, 0, { { 0, 0 } } };
159
160inline uint64_t UpdateTLSRandom64(IdGen* g) {
161 if (!g->init) {
162 g->init = true;
163 init_fast_rand_seed(&g->seed);
164 }
165 const uint64_t val = fast_rand(&g->seed);
166 g->current_random = val;
167 return val;
168}
169
170inline uint64_t GenerateSpanId() {
171 // 0 is an invalid Id

Callers 2

GenerateSpanIdFunction · 0.85
GenerateTraceIdFunction · 0.85

Calls 2

init_fast_rand_seedFunction · 0.85
fast_randFunction · 0.85

Tested by

no test coverage detected