diff --git a/sdlib/d/gc/thread.d b/sdlib/d/gc/thread.d index 5c86d1023..ff89eba71 100644 --- a/sdlib/d/gc/thread.d +++ b/sdlib/d/gc/thread.d @@ -38,6 +38,13 @@ void createThread() { } void destroyThread() { + /** + * Note: we are about to remove the thread from the active thread + * list, we do not want to suspend, because the thread will never be + * woken up. Therefore -- no exitBusyState. + */ + enterBusyState(); + threadCache.destroyThread(); gThreadState.remove(&threadCache); }