diff --git a/source/vibe/core/taskpool.d b/source/vibe/core/taskpool.d index eb53467a..ed71a3f7 100644 --- a/source/vibe/core/taskpool.d +++ b/source/vibe/core/taskpool.d @@ -289,8 +289,12 @@ shared final class TaskPool { } runTaskDist(settings, &call, ch, func, args); - foreach (i; 0 .. this.threadCount) - on_handle(ch.consumeOne()); + foreach (i; 0 .. this.threadCount) { + Task t; + if (!ch.tryConsumeOne(t)) + assert(false, "Worker thread failed to report task handle"); + on_handle(t); + } ch.close(); } diff --git a/source/vibe/internal/array.d b/source/vibe/internal/array.d index 7ea88035..92428ebc 100644 --- a/source/vibe/internal/array.d +++ b/source/vibe/internal/array.d @@ -109,7 +109,7 @@ struct AllocAppender(ArrayType : E[], E) { m_remaining = m_remaining[1 .. $]; } - void put(ArrayType arr) + void put(scope ArrayType arr) @safe { if (m_remaining.length < arr.length) grow(arr.length); m_remaining[0 .. arr.length] = arr[]; @@ -117,7 +117,7 @@ struct AllocAppender(ArrayType : E[], E) { } static if( !hasAliasing!E ){ - void put(in ElemType[] arr) @trusted { + void put(scope const(ElemType)[] arr) @trusted { put(cast(ArrayType)arr); } }