             print("testAsyncBarrierFunction() @ \(#line) (\(i+1)/\(IterationsOfBarrierTest)): creating semaphore")
 
             let semaphore = NSCondition()
+            let startingGun = NSCondition()
 
             print("testAsyncBarrierFunction() @ \(#line) (\(i+1)/\(IterationsOfBarrierTest)): v testBarrierWithSemaphore()")
-            testBarrierWithSemaphore(semaphore)
+            testBarrier(with: semaphore, startingGun: startingGun)
             print("testAsyncBarrierFunction() @ \(#line) (\(i+1)/\(IterationsOfBarrierTest)): ^ testBarrierWithSemaphore()")
 
             let waitingFor = IterationsPerBarrierStage * 3  // because there are 3 test stages

                async {
                    XCTAssertTrue(!NSThread.isMainThread())

                    print("testBarrierWithSemaphore() @ \(#line) (\(i+1)/\(self.IterationsPerBarrierStage)): v semaphore.lock() -- postBarrierStage")
                    semaphore.lock()
                    print("testBarrierWithSemaphore() @ \(#line) (\(i+1)/\(self.IterationsPerBarrierStage)): ^ semaphore.lock() -- postBarrierStage")


                    XCTAssertTrue(preBarrierStageCompleted == self.IterationsPerBarrierStage)
                    XCTAssertTrue(inBarrierStageCompleted == self.IterationsPerBarrierStage)


            print("testAsyncBarrierFunction() @ \(#line) (\(i+1)/\(IterationsOfBarrierTest)): v semaphore.lock()")
            semaphore.lock()
            print("testAsyncBarrierFunction() @ \(#line) (\(i+1)/\(IterationsOfBarrierTest)): ^ semaphore.lock()")

            print("testAsyncBarrierFunction() @ \(#line): v startingGun.lock()")
            startingGun.lock()
            print("testAsyncBarrierFunction() @ \(#line): ^ startingGun.lock()")
            startAsyncWork = true
            print("testAsyncBarrierFunction() @ \(#line): v startingGun.broadcast()")
            startingGun.broadcast()
            print("testAsyncBarrierFunction() @ \(#line): ^ startingGun.broadcast()")
            print("testAsyncBarrierFunction() @ \(#line): v startingGun.unlock()")
            startingGun.unlock()
            print("testBarrierWithSemaphore() @ \(#line): ^ startingGun.unlock()")

            while completed < waitingFor {
                print("testAsyncBarrierFunction() @ \(#line) (\(i+1)/\(IterationsOfBarrierTest)): v semaphore.waitUntilDate()")
                let result = semaphore.waitUntilDate(NSDate().dateByAddingTimeInterval(1.1))
