search for: threadlocaldata

Displaying 2 results from an estimated 2 matches for "threadlocaldata".

2017 Nov 16
2
question about xray tls data initialization
...written as // Using pthread_once(...) to initialize the thread-local data structures but at line 175, 183, code written as thread_local pthread_key_t key; // Ensure that we only actually ever do the pthread initialization once. thread_local bool UNUSED Unused = [] { new (&TLSBuffer) ThreadLocalData(); auto result = pthread_key_create(&key, +[](void *) { auto &TLD = *reinterpret_cast<ThreadLocalData *>(&TLSBuffer); I'm confused that pthread_key_t and Unused are both thread_local variable, doesn't it mean the following lambda will run for each thread , and...
2017 Nov 21
2
question about xray tls data initialization
...to initialize the thread-local data structures > > > but at line 175, 183, code written as > > thread_local pthread_key_t key; > > // Ensure that we only actually ever do the pthread initialization once. > thread_local bool UNUSED Unused = [] { > new (&TLSBuffer) ThreadLocalData(); > auto result = pthread_key_create(&key, +[](void *) { > auto &TLD = *reinterpret_cast<ThreadLocalData *>(&TLSBuffer); > > > I'm confused that pthread_key_t and Unused are both thread_local > variable, doesn't it mean the following lambda will...