Xcode 14 introduced the NSLocking.withLock(_:) method to the Darwin implementation of Foundation. This new method is missing from the open-source implementation.
(Note: The documentation incorrectly specifies the availability of the method as iOS 16+, etc. but it is actually available on all OS versions because it is marked @_alwaysEmitIntoClient. The documentation bug is tracked by FB11968310.)