Code example for Semaphore

Methods: acquireUninterruptibly

0
                        }}} 
                : 
                new Runnable() {
                    public void run() { 
                        try { 
                            sem.acquireUninterruptibly();
                        } catch (Throwable t) {
                            badness[0] = t;
                            throw new Error(t);
                        }}}; 
 
            Thread b1 = new Thread(blocker);
            Thread b2 = new Thread(blocker);
            Runnable signaller = new Runnable() {
                public void run() { 
                    try { 
                        sem.release();
                    } catch (Throwable t) {
                        badness[0] = t;
                        throw new Error(t);