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: