Fixes crap

This commit is contained in:
Sotr
2018-08-11 00:09:00 +08:00
parent 90adbd71c7
commit b4fa26e0c1

View File

@@ -12,7 +12,7 @@ public class ReentrantSpinningLock {
long currentThreadId = Thread.currentThread().getId();
if (heldThreadId == currentThreadId) {
reentrantLocks.getAndIncrement(); // Reentrant
} else if (heldThreadId != 0) {
} else {
while (heldThreadId != 0) ; // The current thread is spinning here
}
tryLock(currentThreadId);