Avatar
ConcurrentValue and @concurrent closures Authors: Chris Lattner, Doug Gregor February 3, 2021 Draft #4 Major Contributors: Dave Abrahams, Paul Cantrell, Matthew Johnson, John McCall, Jordan Rose Introduction The Swift Concurrency Roadmap was recently announced, and a key goal of that roadmap is...
1:11 PM
Support for Imported C / Objective-C APIs Interoperability with C and Objective-C is an important part of Swift. C code will always be implicitly unsafe for concurrency, because Swift cannot enforce correct behavior of C APIs. However, we still define some basic interactions with the concurrency model by providing implicit ConcurrentValue conformances for many C types: C enum types always conform to the ConcurrentValue protocol. C struct types conform to the ConcurrentValue protocol if all of their stored properties conform to ConcurrentValue. C function pointers conform to the ConcurrentValue protocol. This is safe because they cannot capture values.