diff options
Diffstat (limited to 'libphobos/src/std/concurrency.d')
-rw-r--r-- | libphobos/src/std/concurrency.d | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libphobos/src/std/concurrency.d b/libphobos/src/std/concurrency.d index fb383ae..bc53236 100644 --- a/libphobos/src/std/concurrency.d +++ b/libphobos/src/std/concurrency.d @@ -257,9 +257,12 @@ private @property ref ThreadInfo thisInfo() nothrow { - if (scheduler is null) + import core.atomic : atomicLoad; + + auto localScheduler = atomicLoad(scheduler); + if (localScheduler is null) return ThreadInfo.thisInfo; - return scheduler.thisInfo; + return localScheduler.thisInfo; } } |