Skip to content

Commit 87031a5

Browse files
dkorpeldlang-bot
authored andcommitted
Make thread_init and thread_term nothrow
1 parent ff2e9e8 commit 87031a5

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/core/thread/osthread.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1926,7 +1926,7 @@ private extern (D) void resume(ThreadBase _t) nothrow @nogc
19261926
* garbage collector on startup and before any other thread routines
19271927
* are called.
19281928
*/
1929-
extern (C) void thread_init() @nogc
1929+
extern (C) void thread_init() @nogc nothrow
19301930
{
19311931
// NOTE: If thread_init itself performs any allocations then the thread
19321932
// routines reserved for garbage collector use may be called while
@@ -2013,7 +2013,7 @@ package __gshared align(__traits(classInstanceAlignment, Thread)) MainThreadStor
20132013
* Terminates the thread module. No other thread routine may be called
20142014
* afterwards.
20152015
*/
2016-
extern (C) void thread_term() @nogc
2016+
extern (C) void thread_term() @nogc nothrow
20172017
{
20182018
thread_term_tpl!(Thread)(_mainThreadStore);
20192019
}

src/core/thread/threadbase.d

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -565,14 +565,14 @@ package(core.thread):
565565
__gshared align(mutexAlign) void[mutexClassInstanceSize] _slock;
566566
__gshared align(mutexAlign) void[mutexClassInstanceSize] _criticalRegionLock;
567567

568-
static void initLocks() @nogc
568+
static void initLocks() @nogc nothrow
569569
{
570570
import core.lifetime : emplace;
571571
emplace!Mutex(_slock[]);
572572
emplace!Mutex(_criticalRegionLock[]);
573573
}
574574

575-
static void termLocks() @nogc
575+
static void termLocks() @nogc nothrow
576576
{
577577
(cast(Mutex)_slock.ptr).__dtor();
578578
(cast(Mutex)_criticalRegionLock.ptr).__dtor();
@@ -752,13 +752,13 @@ package(core.thread):
752752

753753
private alias attachThread = externDFunc!("core.thread.osthread.attachThread", ThreadBase function(ThreadBase) @nogc nothrow);
754754

755-
extern (C) void _d_monitordelete_nogc(Object h) @nogc;
755+
extern (C) void _d_monitordelete_nogc(Object h) @nogc nothrow;
756756

757757
/**
758758
* Terminates the thread module. No other thread routine may be called
759759
* afterwards.
760760
*/
761-
package void thread_term_tpl(ThreadT, MainThreadStore)(ref MainThreadStore _mainThreadStore) @nogc
761+
package void thread_term_tpl(ThreadT, MainThreadStore)(ref MainThreadStore _mainThreadStore) @nogc nothrow
762762
{
763763
assert(_mainThreadStore.ptr is cast(void*) ThreadBase.sm_main);
764764

@@ -1328,13 +1328,13 @@ package
13281328
return cast(Mutex)ll_lock.ptr;
13291329
}
13301330

1331-
void initLowlevelThreads() @nogc
1331+
void initLowlevelThreads() @nogc nothrow
13321332
{
13331333
import core.lifetime : emplace;
13341334
emplace(lowlevelLock());
13351335
}
13361336

1337-
void termLowlevelThreads() @nogc
1337+
void termLowlevelThreads() @nogc nothrow
13381338
{
13391339
lowlevelLock.__dtor();
13401340
}

src/rt/dmain2.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ extern (C) void _d_critical_init() @nogc nothrow;
6565
extern (C) void _d_critical_term() @nogc nothrow;
6666
extern (C) void gc_init();
6767
extern (C) void gc_term();
68-
extern (C) void thread_init() @nogc;
69-
extern (C) void thread_term() @nogc;
68+
extern (C) void thread_init() @nogc nothrow;
69+
extern (C) void thread_term() @nogc nothrow;
7070
extern (C) void lifetime_init();
7171
extern (C) void rt_moduleCtor();
7272
extern (C) void rt_moduleTlsCtor();

src/rt/monitor_.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ extern (C) void _d_monitordelete(Object h, bool det)
5454
}
5555

5656
// does not call dispose events, for internal use only
57-
extern (C) void _d_monitordelete_nogc(Object h) @nogc
57+
extern (C) void _d_monitordelete_nogc(Object h) @nogc nothrow
5858
{
5959
auto m = getMonitor(h);
6060
if (m is null)

0 commit comments

Comments
 (0)