Wolfgang Thallergcc 15.1.0ada185d1 year agoHistory
38 lines · 870 B · D
RawDownload
module core.thread.test; // needs access to getStackTop()/getStackBottom() import core.stdc.stdio : printf;import core.thread; ubyte[16384] data; void showThreadInfo() nothrow{    try    {        auto top = getStackTop();        auto bottom = getStackBottom();        printf("tlsdata:     %p\n", data.ptr);        printf("stack top:   %p\n", getStackTop());        printf("stack bottom:%p\n", getStackBottom());        printf("used stack:  %lld\n", cast(ulong)(bottom - top));    }    catch(Exception e)    {        assert(false, e.msg);    }} void main(){    printf("### main\n");    showThreadInfo();     printf("### thread\n");    auto th = new Thread(&showThreadInfo, 16384);    th.start();    th.join();     printf("### lowlevel thread\n");    auto llth = createLowLevelThread(() { showThreadInfo(); });    joinLowLevelThread(llth);}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t