Opened 11 months ago

Last modified 7 weeks ago

#43 accepted defect

Fix thread_local

Reported by: Vladimír Štill Owned by: mornfall
Priority: major Milestone: 4.5
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 (3)

comment:1 Changed 10 months ago by mornfall

Milestone: future5.0

Milestone renamed

comment:2 Changed 10 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.

comment:3 Changed 7 weeks ago by mornfall

Milestone: 4.34.5
Status: newaccepted
Note: See TracTickets for help on using tickets.