1 import core
.memory
, core
.thread
, core
.volatile;
4 * This test repeatedly performs operations on GC-allocated objects which
5 * are only reachable from TLS storage. Tests are performed in multiple threads
6 * and GC collections are triggered repeatedly, so if the GC does not properly
7 * scan TLS memory, this provokes a crash.
14 auto val
= volatileLoad(&a
);
16 volatileStore(&a
, val
);
24 tlsPtr
= new TestTLS();
31 for (size_t i
= 0; i
< 100; i
++)
33 Thread
.sleep(10.msecs
);
40 for (size_t i
= 0; i
< 20; i
++)
42 auto t
= new Thread(&runThread
);
48 foreach (thread
; threads
)