Skip to content

Commit 4d4bb4d

Browse files
committed
i need to figure out the ldc bug that breaks scope(exit) critical sections but until then ill rewrite it
1 parent 2ee5497 commit 4d4bb4d

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

phobos/std/parallelism.d

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,16 +1156,6 @@ private:
11561156
assert(job.next is null);
11571157
assert(job.prev is null);
11581158

1159-
scope(exit)
1160-
{
1161-
if (!isSingleTask)
1162-
{
1163-
waiterLock();
1164-
scope(exit) waiterUnlock();
1165-
notifyWaiters();
1166-
}
1167-
}
1168-
11691159
try
11701160
{
11711161
job.job();
@@ -1176,6 +1166,13 @@ private:
11761166
}
11771167

11781168
atomicSetUbyte(job.taskStatus, TaskStatus.done);
1169+
1170+
if (!isSingleTask)
1171+
{
1172+
waiterLock();
1173+
scope(exit) waiterUnlock();
1174+
notifyWaiters();
1175+
}
11791176
}
11801177

11811178
// This function is used for dummy pools created by Task.executeInNewThread().

0 commit comments

Comments
 (0)