/** * If there is another semaphore with the same runnable in the * queue, the other is returned and the new one is not added. */ private synchronized Semaphore enqueue(Semaphore newSemaphore) { Semaphore semaphore = (Semaphore) operations.get(newSemaphore); if (semaphore == null) { operations.enqueue(newSemaphore); return newSemaphore; } return semaphore; }
/** * If there is another semaphore with the same runnable in the * queue, the other is returned and the new one is not added. */ private synchronized Semaphore enqueue(Semaphore newSemaphore) { Semaphore semaphore = (Semaphore) operations.get(newSemaphore); if (semaphore == null) { operations.enqueue(newSemaphore); return newSemaphore; } return semaphore; }
/** * If there is another semaphore with the same runnable in the * queue, the other is returned and the new one is not added. */ private synchronized Semaphore enqueue(Semaphore newSemaphore) { Semaphore semaphore = (Semaphore) operations.get(newSemaphore); if (semaphore == null) { operations.enqueue(newSemaphore); return newSemaphore; } return semaphore; }
/** * If there is another semaphore with the same runnable in the * queue, the other is returned and the new one is not added. */ private synchronized Semaphore enqueue(Semaphore newSemaphore) { Semaphore semaphore = (Semaphore) operations.get(newSemaphore); if (semaphore == null) { operations.enqueue(newSemaphore); return newSemaphore; } return semaphore; }