Opened 3 months ago

Last modified 2 months ago

#43 new defect

Fix thread_local

Reported by: Vladimír Štill Owned by: mornfall
Priority: major Milestone: 4.3
Component: VM Keywords:
Cc:

Description

Currently, the thread_local keyword is not supported. Even worse, it is silently ignored:

#include <thread>
#include <cassert>

thread_local int v;

int main()
{
    v = 42;
    std::thread t( [] {
        assert( v == 0 );
        v = 16;
        assert( v == 16 );
    } );
    assert( v == 42 );
    t.join();
}

Change History (2)

comment:1 Changed 3 months ago by mornfall

Milestone: future5.0

Milestone renamed

comment:2 Changed 2 months ago by mornfall

Milestone: 5.04.3

Indeed, this leads to LLVM thread_local. Same thing happens with function-scoped thread_local variables. Let's aim for 4.3.

Note: See TracTickets for help on using tickets.