         executor(resolve)
     }
     
-    fileprivate func resolve(_ promise: Promise<T>) {
+    private func resolve(_ promise: Promise<T>) {
         promise.reserve {
             self.lock.lock()
             if self.value == nil {

import Foundation

public class Promise<T> {
    fileprivate let lock = NSRecursiveLock()
    
    fileprivate var value: T?
    fileprivate var handlers: [(T) -> ()] = []
    
    public init(_ value: T) {
        self.value = value

        }
    }
    
    private func reserve(_ handler: @escaping (T) -> ()) {
        lock.lock()
        if let value = self.value {
            handler(value)
