@@ -20,9 +20,9 @@ import core.stdc.stdlib : free, realloc;
20
20
21
21
private
22
22
{
23
- // interface to rt.tlsgc
24
23
import core.internal.traits : externDFunc;
25
24
25
+ // interface to rt.tlsgc
26
26
alias rt_tlsgc_init = externDFunc! (" rt.tlsgc.init" , void * function () nothrow @nogc );
27
27
alias rt_tlsgc_destroy = externDFunc! (" rt.tlsgc.destroy" , void function (void * ) nothrow @nogc );
28
28
@@ -84,10 +84,8 @@ private
84
84
85
85
extern (C ) void * swapContext(void * newContext) nothrow @nogc ;
86
86
87
- extern extern (C) immutable size_t threadSizeof;
88
-
89
- extern (C ) void * getStackBottom() nothrow @nogc ;
90
- extern (C ) void * getStackTop() nothrow @nogc ;
87
+ alias getStackBottom = externDFunc! (" core.thread.osthread.getStackBottom" , void * function () nothrow @nogc );
88
+ alias getStackTop = externDFunc! (" core.thread.osthread.getStackTop" , void * function () nothrow @nogc );
91
89
}
92
90
93
91
@@ -355,7 +353,7 @@ class ThreadBase
355
353
{
356
354
static void resize (ref ThreadBase[] buf, size_t nlen)
357
355
{
358
- buf = (cast (ThreadBase* )realloc(buf.ptr, nlen * threadSizeof ))[0 .. nlen];
356
+ buf = (cast (ThreadBase* )realloc(buf.ptr, nlen * size_t .sizeof ))[0 .. nlen];
359
357
}
360
358
auto buf = getAllImpl! resize;
361
359
scope (exit) if (buf.ptr) free(buf.ptr);
@@ -690,9 +688,9 @@ package(core.thread):
690
688
}
691
689
assert (idx != - 1 );
692
690
import core.stdc.string : memmove;
693
- memmove(pAboutToStart + idx, pAboutToStart + idx + 1 , threadSizeof * (nAboutToStart - idx - 1 ));
691
+ memmove(pAboutToStart + idx, pAboutToStart + idx + 1 , size_t .sizeof * (nAboutToStart - idx - 1 ));
694
692
pAboutToStart =
695
- cast (ThreadBase* )realloc(pAboutToStart, threadSizeof * -- nAboutToStart);
693
+ cast (ThreadBase* )realloc(pAboutToStart, size_t .sizeof * -- nAboutToStart);
696
694
}
697
695
698
696
if (sm_tbeg)
@@ -756,7 +754,7 @@ package(core.thread):
756
754
// GC Support Routines
757
755
// /////////////////////////////////////////////////////////////////////////////
758
756
759
- extern ( C ) ThreadBase attachThread (ThreadBase thisThread ) @nogc ;
757
+ private alias attachThread = externDFunc ! ( " core.thread.osthread.attachThread " , ThreadBase function (ThreadBase) @nogc ) ;
760
758
761
759
extern (C ) void _d_monitordelete_nogc(Object h) @nogc ;
762
760
@@ -969,7 +967,7 @@ package __gshared bool multiThreadedFlag = false;
969
967
// Used for suspendAll/resumeAll below.
970
968
package __gshared uint suspendDepth = 0 ;
971
969
972
- private extern (C) void resume (ThreadBase) nothrow ;
970
+ private alias resume = externDFunc ! ( " core.thread.osthread.resume " , void function (ThreadBase) nothrow ) ;
973
971
974
972
/**
975
973
* Resume all threads but the calling thread for "stop the world" garbage
1044
1042
}
1045
1043
1046
1044
package alias callWithStackShellDg = void delegate (void * sp) nothrow ;
1047
- private extern (C) void callWithStackShell (scope callWithStackShellDg fn ) nothrow ;
1045
+ private alias callWithStackShell = externDFunc ! ( " core.thread.osthread.callWithStackShell " , void function (scope callWithStackShellDg) nothrow ) ;
1048
1046
1049
1047
private void scanAllTypeImpl (scope ScanAllThreadsTypeFn scan, void * curStackTop) nothrow
1050
1048
{
@@ -1125,7 +1123,7 @@ extern (C) void thread_scanAll(scope ScanAllThreadsFn scan) nothrow
1125
1123
thread_scanAllType((type, p1, p2) => scan(p1, p2));
1126
1124
}
1127
1125
1128
- private extern (C) static void thread_yield () @nogc nothrow ;
1126
+ private alias thread_yield = externDFunc ! ( " core.thread.osthread.thread_yield " , void function () @nogc nothrow ) ;
1129
1127
1130
1128
/**
1131
1129
* Signals that the code following this call is a critical region. Any code in
0 commit comments