Skip to content
Advertisement

Tag: semaphore

Java: Using Semaphore with timer

Hello im trying to synchronize classes using semaphore.acquire() and semaphore.release(). I’m calling semaphore.release() from a class named ReadSerialPort and semaphore.acquire() from WriteSerialPort to connect a phone-center to PC. My problem is that phone-center is not always responding. I would like to know a way to set timer and make semaphore.release() after the time has past. P.S: I tried using TimedSemaphore

Advertisement