Does Swift provide something like @synchronized in objc?

Does Swift provide such shorthand/sugar syntax for commonly used thread synchronization?

Answered by DTS Engineer in 776322022

Does Swift provide something like @synchronized in objc?

Yes, although the details are very different. In Swift concurrency, the role of @synchronized is subsumed by actors. There is a bunch of info available on this topic. You can find my specific recommendations in the Concurrency Resources post.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

Does Swift provide something like @synchronized in objc?

Yes, although the details are very different. In Swift concurrency, the role of @synchronized is subsumed by actors. There is a bunch of info available on this topic. You can find my specific recommendations in the Concurrency Resources post.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Does Swift provide something like @synchronized in objc?
 
 
Q