Override of sync. method needs to be sync.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1388090 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
59702fcddc
commit
f25a596ae9
|
@ -405,7 +405,7 @@ public class TimedSemaphoreTest {
|
|||
* Invokes the latch if one is set.
|
||||
*/
|
||||
@Override
|
||||
public void acquire() throws InterruptedException {
|
||||
public synchronized void acquire() throws InterruptedException {
|
||||
super.acquire();
|
||||
if (latch != null) {
|
||||
latch.countDown();
|
||||
|
@ -416,11 +416,9 @@ public class TimedSemaphoreTest {
|
|||
* Counts the number of invocations.
|
||||
*/
|
||||
@Override
|
||||
protected void endOfPeriod() {
|
||||
protected synchronized void endOfPeriod() {
|
||||
super.endOfPeriod();
|
||||
synchronized (this) {
|
||||
periodEnds++;
|
||||
}
|
||||
periodEnds++;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue