Post

Replies

Boosts

Views

Activity

Reply to Warning: Reference to captured var 'hashBag' in concurrently-executing code
I have found the solution myself. It's actually straightforward, set project min platform to 10.15 and I can do this without warnings anymore: Task { bagLock.lock() hashBag["file"] = hash bagLock.unlock() } Actor is too heavy for this scenario because I have several variables like this in an async function; Mutex is quite new and my project has to target a much older platform like 10.15 which enables me to use Task async.
Topic: Programming Languages SubTopic: Swift Tags:
Apr ’25