mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-12 04:23:54 +00:00
Fix DelegateSemaphore synchronisation issues on Spigot (#1781)
* Fix DelegateSemaphore synchronisation issues on Spigot - Also effectively nullify it on paper - the synchronisation on the object is enough * Remove unneeded imports
This commit is contained in:
@ -14,6 +14,9 @@ public class DelegateSemaphore extends Semaphore {
|
||||
// this is bad
|
||||
@Override
|
||||
public synchronized boolean tryAcquire() {
|
||||
if (delegate == null) {
|
||||
return true;
|
||||
}
|
||||
try {
|
||||
this.delegate.acquire();
|
||||
return true;
|
||||
@ -24,11 +27,17 @@ public class DelegateSemaphore extends Semaphore {
|
||||
|
||||
@Override
|
||||
public synchronized void acquire() throws InterruptedException {
|
||||
if (delegate == null) {
|
||||
return;
|
||||
}
|
||||
this.delegate.acquire();
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void release() {
|
||||
public void release() {
|
||||
if (delegate == null) {
|
||||
return;
|
||||
}
|
||||
this.delegate.release();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user