/** Acquires the semaphore. Also, the first execution of this method retrieves the semaphore by name and stores it locally. * <p> * This method is called when the task is entered. */ @Override public void start () { if (semaphore == null) { semaphore = NonBlockingSemaphoreRepository.getSemaphore(name); } semaphoreAcquired = semaphore.acquire(); super.start(); }
/** Releases the semaphore. * <p> * This method is called when the task exits. */ @Override public void end () { if (semaphoreAcquired) { if (semaphore == null) { semaphore = NonBlockingSemaphoreRepository.getSemaphore(name); } semaphore.release(); semaphoreAcquired = false; } super.end(); }
/** Acquires the semaphore. Also, the first execution of this method retrieves the semaphore by name and stores it locally. * <p> * This method is called when the task is entered. */ @Override public void start () { if (semaphore == null) { semaphore = NonBlockingSemaphoreRepository.getSemaphore(name); } semaphoreAcquired = semaphore.acquire(); super.start(); }
/** Releases the semaphore. * <p> * This method is called when the task exits. */ @Override public void end () { if (semaphoreAcquired) { if (semaphore == null) { semaphore = NonBlockingSemaphoreRepository.getSemaphore(name); } semaphore.release(); semaphoreAcquired = false; } super.end(); }
/** Acquires the semaphore. Also, the first execution of this method retrieves the semaphore by name and stores it locally. * <p> * This method is called when the task is entered. */ @Override public void start () { if (semaphore == null) { semaphore = NonBlockingSemaphoreRepository.getSemaphore(name); } semaphoreAcquired = semaphore.acquire(); super.start(); }
/** Releases the semaphore. * <p> * This method is called when the task exits. */ @Override public void end () { if (semaphoreAcquired) { if (semaphore == null) { semaphore = NonBlockingSemaphoreRepository.getSemaphore(name); } semaphore.release(); semaphoreAcquired = false; } super.end(); }