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

Function thread_getspecific

src/butil/thread_key.cpp:156–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156void* thread_getspecific(ThreadKey& thread_key) {
157 if (BAIDU_UNLIKELY(!thread_key.Valid())) {
158 return NULL;
159 }
160 size_t id = thread_key._id;
161 size_t seq = thread_key._seq;
162 if (BAIDU_UNLIKELY(!thread_key_tls_data ||
163 id >= thread_key_tls_data->size() ||
164 (*thread_key_tls_data)[id].seq != seq)){
165 return NULL;
166 }
167
168 return (*thread_key_tls_data)[id].data;
169}
170
171} // namespace butil

Callers 4

TESTFunction · 0.85
ThreadKeyFuncFunction · 0.85
ThreadKeyPerfFuncFunction · 0.85
getMethod · 0.85

Calls 2

ValidMethod · 0.80
sizeMethod · 0.45

Tested by 3

TESTFunction · 0.68
ThreadKeyFuncFunction · 0.68
ThreadKeyPerfFuncFunction · 0.68