Code example for CountDownLatch

Methods: getCount

0
        } 
        public void waitForStart() throws InterruptedException { 
            startLatch.await(5000, TimeUnit.MILLISECONDS);
        } 
        public boolean isStarted() { 
            return startLatch.getCount() == 0;
        } 
        public void checkPoint() { 
            checkLatch.countDown();
        } 
        public void waitForEnd() throws InterruptedException { 
            endLatch.await(5000, TimeUnit.MILLISECONDS);
        } 
        public boolean isEnded() { 
            return endLatch.getCount() == 0;
        } 
        private class TestTask extends AsyncTask<Void, Void, Void> {
            @Override 
            protected Void doInBackground(Void... params) {
                startLatch.countDown();
                try {