Code example for CountDownLatch

Methods: countDown

0
                        } 
                    }.call(); 
                } catch (Exception e) {
                    exceptions[0] = e;
                } finally { 
                    latch.countDown();
                } 
            } 
        }); 
 
        // Wait for onSuccess to finish 
        latch.await();
 
        if (exceptions[0] != null)
            throw exceptions[0];
 
    } 
 
    void afterCall(final ResultT result, final Exception e) {
        handler.post(new Runnable() {
            @Override