1int storage = 45;
2thread_local int tl_global_int = 123;
3thread_local int *tl_global_ptr = &storage;
4
5int main(int argc, char **argv) {
6 thread_local int tl_local_int = 321;
7 thread_local int *tl_local_ptr = nullptr;
8 tl_local_ptr = &tl_local_int;
9 tl_local_int++;
10 return 0; // Set breakpoint here
11}
12

Provided by KDAB

Privacy Policy
Update your C++ knowledge – Modern C++11/14/17 Training
Find out more

source code of lldb/test/API/lang/cpp/thread_local/main.cpp