From cef4885a63e39fc3bdbe40dcc7aca11355a31c06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Wed, 18 Mar 2020 15:32:26 +0100 Subject: [PATCH] Update change log. --- source/vibe/core/file.d | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/vibe/core/file.d b/source/vibe/core/file.d index fe8cf6b..d679b22 100644 --- a/source/vibe/core/file.d +++ b/source/vibe/core/file.d @@ -13,6 +13,7 @@ import vibe.core.internal.release; import vibe.core.log; import vibe.core.path; import vibe.core.stream; +import vibe.core.task : Task, TaskSettings; import vibe.internal.async : asyncAwait, asyncAwaitUninterruptible; import core.stdc.stdio; @@ -357,7 +358,9 @@ void listDirectory(string path, scope bool delegate(FileInfo info) @safe del) } auto ch = createChannel!S(); - runWorkerTaskH((string path, Channel!S ch) nothrow { + TaskSettings ts; + ts.priority = 10 * Task.basePriority; + runWorkerTaskH(ioTaskSettings, (string path, Channel!S ch) nothrow { scope (exit) ch.close(); try { foreach (DirEntry ent; dirEntries(path, SpanMode.shallow)) { @@ -895,7 +898,7 @@ private auto performInWorker(C, ARGS...)(C callable, auto ref ARGS args) alias RET = typeof(callable(args)); shared(RET) ret; - runWorkerTask((shared(RET)* r, Tid caller, C c, ref ARGS a) nothrow { + runWorkerTask(ioTaskSettings, (shared(RET)* r, Tid caller, C c, ref ARGS a) nothrow { *() @trusted { return cast(RET*)r; } () = c(a); // Just as a precaution, because ManualEvent is not well defined in // terms of fence semantics @@ -908,3 +911,5 @@ private auto performInWorker(C, ARGS...)(C callable, auto ref ARGS args) return ret; } } + +private immutable TaskSettings ioTaskSettings = { priority: 20 * Task.basePriority };