From 0d4b499eab8ea06910e0e8768d58b34463d459fe Mon Sep 17 00:00:00 2001 From: Andrey Ufimtsev Date: Wed, 29 May 2019 15:26:44 +0200 Subject: [PATCH] Make Property.on() thread-safe --- Sources/Property.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/Property.swift b/Sources/Property.swift index 54975ae..f04745e 100644 --- a/Sources/Property.swift +++ b/Sources/Property.swift @@ -59,6 +59,7 @@ public final class Property: PropertyProtocol, SubjectProtocol, BindableP } public func on(_ event: Event) { + lock.lock(); defer { lock.unlock() } if case .next(let element) = event { _value = element }