Per additional discussion and feedback in apple/swift-nio#1508, we're removing the message parameter from the precondition assertion methods entirely. Added a couple of missing @inlinables to match the declarations now present over there as well. (#85)

This commit is contained in:
Gwynne Raskind 2020-05-07 06:50:39 -05:00 committed by GitHub
parent fe7e340f41
commit 4eb9bebfb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 7 deletions

View File

@ -160,16 +160,13 @@ internal class NIOTSEventLoop: QoSEventLoop {
}
}
public func preconditionInEventLoop(_ message: @autoclosure() -> String, file: StaticString, line: UInt) {
/// `dispatchPrecondition(condition:)` is unable to accept an error message for the failure case, and we
/// can not safely rely on `self.inEventLoop` in this implementation. Any message provided by the caller
/// must therefore be ignored. We do not foresee ever being able to fix this behavior, given the design
/// constraints of the respective subsystems.
@inlinable
public func preconditionInEventLoop(file: StaticString, line: UInt) {
dispatchPrecondition(condition: .onQueue(self.loop))
}
public func preconditionNotInEventLoop(_ message: @autoclosure() -> String = "", file: StaticString, line: UInt) {
/// As in our counterpart method, we can't do anything with the `message` parameter. See above for details.
@inlinable
public func preconditionNotInEventLoop(file: StaticString, line: UInt) {
dispatchPrecondition(condition: .notOnQueue(self.loop))
}
}