Exemplo n.º 1
0
void test_threadlocalstroage()
{
    g_tls->set(10);
    g_tls->print();

    Thread t1(std::bind(testTLS, 23));
    t1.join();

    Thread t2(std::bind(testTLS, 100));
    t2.join();

    g_tls->print();
}
Exemplo n.º 2
0
void testTLS(int i)
{
    g_tls->plus(i);
    g_tls->print();
}