1 import core
.sys
.posix
.pthread
;
5 extern (C
) void rt_moduleTlsCtor();
6 extern (C
) void rt_moduleTlsDtor();
9 void* entry_point1(void*)
11 // try collecting - GC must ignore this call because this thread
12 // is not registered in runtime
18 void* entry_point2(void*)
20 // This thread gets registered in druntime, does some work and gets
21 // unregistered to be cleaned up manually
34 // allocate some garbage
35 auto x
= new int[1000];
39 auto status
= pthread_create(&thread
, null, &entry_point1
, null);
41 pthread_join(thread
, null);
46 auto status
= pthread_create(&thread
, null, &entry_point2
, null);
48 pthread_join(thread
, null);