Java tutorial
//package com.java2s; import java.util.concurrent.Semaphore; public class Main { public static void acquire(Semaphore semaphore) { try { semaphore.acquire(); } catch (InterruptedException iex) { // ignore } } public static void acquire(Semaphore semaphore, int permits) { try { semaphore.acquire(permits); } catch (InterruptedException iex) { // ignore } } }