 }
 
 final private class JAsyncAdapter<Value, Error: ErrorType> : AsyncInterface {
-    
+
     let jobWithProgress: AsyncTypes<Value, Error>.SyncOperationWithProgress
     let queueName      : String?
     let barrier        : Bool
     let currentQueue   : dispatch_queue_t
     let queueAttributes: dispatch_queue_attr_t
-    
+
     init(jobWithProgress: AsyncTypes<Value, Error>.SyncOperationWithProgress,
          queueName      : String?,
          barrier        : Bool,
          currentQueue   : dispatch_queue_t,
          queueAttributes: dispatch_queue_attr_t) {
-        
+
         self.jobWithProgress = jobWithProgress
         self.queueName       = queueName
         self.barrier         = barrier
         self.currentQueue    = currentQueue
         self.queueAttributes = queueAttributes
     }
-    
+
     var operation: BlockOperation<Value, Error>? = nil
-    
+
     func asyncWithResultCallback(
         finishCallback  : AsyncTypes<Value, Error>.DidFinishAsyncCallback,
         stateCallback   : AsyncChangeStateCallback,
         progressCallback: AsyncProgressCallback) {
-        
+
         operation = BlockOperation(
             queueName         : queueName,
             jobWithProgress   : jobWithProgress,


//TODO remove this class
final private class BlockOperation<Value, Error: ErrorType> {
    
    private var queue = dispatch_queue_create("BlockOperation.finishedOrCanceled", DISPATCH_QUEUE_SERIAL)
    private var finishedOrCanceled: Bool = false
    
    init(
        queueName         : String?,
        jobWithProgress   : AsyncTypes<Value, Error>.SyncOperationWithProgress,

}

func barrierAsync<Value, Error: ErrorType>(jobWithProgress: AsyncTypes<Value, Error>.SyncOperation, queueName: String) -> AsyncTypes<Value, Error>.Async {

    assert(NSThread.isMainThread())
    return async(
        job         : jobWithProgress,
