Fix compilation of server.cc on hpux.
[official-gcc.git] / libphobos / testsuite / libphobos.thread / tlsstack.d
blobdbd93213bfec19b4d5e5e294ca9ec18b154b1821
1 module core.thread.test; // needs access to getStackTop()/getStackBottom()
3 import core.stdc.stdio;
4 import core.thread;
6 ubyte[16384] data;
8 void showThreadInfo() nothrow
10 try
12 auto top = getStackTop();
13 auto bottom = getStackBottom();
14 printf("tlsdata: %p\n", data.ptr);
15 printf("stack top: %p\n", getStackTop());
16 printf("stack bottom:%p\n", getStackBottom());
17 printf("used stack: %lld\n", cast(ulong)(bottom - top));
19 catch(Exception e)
21 assert(false, e.msg);
25 void main()
27 printf("### main\n");
28 showThreadInfo();
30 printf("### thread\n");
31 auto th = new Thread(&showThreadInfo, 16384);
32 th.start();
33 th.join();
35 printf("### lowlevel thread\n");
36 auto llth = createLowLevelThread(() { showThreadInfo(); });
37 joinLowLevelThread(llth);