1
1
mirror of https://github.com/qvacua/vimr.git synced 2025-01-02 18:54:21 +03:00

Lock conditions somewhere else

This commit is contained in:
Tae Won Ha 2017-12-14 19:22:20 +01:00
parent 76adcb5e79
commit b226bb15a1
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44

View File

@ -47,14 +47,15 @@ public class Connection {
}
public func stop() {
locked(with: self.conditionsLock) {
self.conditions.values.forEach { condition in
locked(with: condition) { condition.broadcast() }
}
}
locked(with: self.sessionLock) {
self.stopped = true
locked(with: self.conditionsLock) {
self.conditions.values.forEach { condition in
locked(with: condition) { condition.broadcast() }
}
}
self.session.disconnectAndStop()
}
}