|
|
@ -5039,13 +5039,16 @@ public class PlayerCharacter extends AbstractCharacter { |
|
|
|
|
|
|
|
|
|
|
|
//if(!newSystem)
|
|
|
|
//if(!newSystem)
|
|
|
|
// return;
|
|
|
|
// return;
|
|
|
|
|
|
|
|
try { |
|
|
|
ReentrantReadWriteLock reentrantLock = (ReentrantReadWriteLock) updateLock; |
|
|
|
ReentrantReadWriteLock reentrantLock = (ReentrantReadWriteLock) updateLock; |
|
|
|
|
|
|
|
|
|
|
|
// Check if the lock is currently held by another thread (either for reading or writing)
|
|
|
|
// Check if the lock is currently held by another thread (either for reading or writing)
|
|
|
|
if (reentrantLock.isWriteLocked() || reentrantLock.getReadLockCount() > 0) { |
|
|
|
if (reentrantLock.isWriteLocked() || reentrantLock.getReadLockCount() > 0) { |
|
|
|
return; // Or throw an exception if needed
|
|
|
|
return; // Or throw an exception if needed
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}catch(Exception e){ |
|
|
|
|
|
|
|
Logger.error(e); |
|
|
|
|
|
|
|
} |
|
|
|
if (this.updateLock.writeLock().tryLock()) { |
|
|
|
if (this.updateLock.writeLock().tryLock()) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
|
|
|
|