public void signalEvent(){
  Collection<Semaphore> semaphores=_semaphores.values();
  for (  Semaphore semaphore : semaphores) {
    semaphore.release();
    semaphores.remove(semaphore);
  }
}

public void signalEvent ( ) { Collection < Semaphore > semaphores = _semaphores . values ( ) ; for ( Semaphore semaphore : semaphores ) { semaphore . release ( ) ; semaphores . remove ( semaphore ) ; } }
signals the semaphore when the event arrives .
