 
         switch self.state {
         case .Pending:
-            self.onRejected.append(onRejectedAsync)
+            performSync {
+                self.onRejected.append(onRejectedAsync)
+            }
         case .Fulfilled(_):
             return
         case .Rejected(let error):


        switch self.state {
        case .Pending:
            self.onFulfilled.append(onFulfilledAsync)
        case .Fulfilled(let value):
            onFulfilledAsync(value)
        case .Rejected(_):

    return q
}()

/**
    Perform given `block` in serial queue. Reentrant, dead lock free.
*/
private func performSync(block: () -> Void) {
    if dispatch_get_specific(&syncQueueTag) == nil {
        dispatch_sync(syncQueue, block)
