             signal.unlock()
         }
 
-        XCTAssert(counter == 0)
+        XCTAssert(protect == 0)
         XCTAssert(remainingThreads == 0)
     }
 

//        }
//        signal.unlock()
//
//        XCTAssert(counter == 0)
//        XCTAssert(remainingThreads == 0)
//    }
}

//
//                // this also tests re-entrancy
//                let gotLock = self.lock.executeWithTimeout(LongWaitTimeout) {
//                    XCTAssertTrue(protect == 0)
//                    protect++
//                    XCTAssertTrue(protect == 1)
//                    protect--
//                    XCTAssertTrue(protect == 0)
//
//                    ExceptionTrap.throwExceptionWithName("try to break the locks")
//                }
