Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit f0abd06

Browse files
author
Mihails Strasuns
committed
Unregister thread even if is the last one
Previously `remove` implementation would early return if removed thread is the only element in the registered list (and thus has no prev/next references)
1 parent f60eb35 commit f0abd06

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/core/thread.d

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1859,8 +1859,9 @@ private:
18591859
do
18601860
{
18611861
// Thread was already removed earlier, might happen b/c of thread_detachInstance
1862-
if (!t.next && !t.prev)
1862+
if (!t.next && !t.prev && (sm_tbeg !is t))
18631863
return;
1864+
18641865
slock.lock_nothrow();
18651866
{
18661867
// NOTE: When a thread is removed from the global thread list its

0 commit comments

Comments
 (0)