We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
每次获取锁都是new出来的RedisReentrantLock,都是不同的threadData,从里面取出数据应该都是空的, LockData lockData = threadData.get(currentThread); if ( lockData != null ) { lockData.lockCount.incrementAndGet(); return true; } String lockVal = internals.tryRedisLock(lockId,timeout,unit); if ( lockVal != null ) { LockData newLockData = new LockData(currentThread, lockVal); threadData.put(currentThread, newLockData); return true; } return false;
LockData lockData = threadData.get(currentThread); if ( lockData != null ) { lockData.lockCount.incrementAndGet(); return true; } String lockVal = internals.tryRedisLock(lockId,timeout,unit); if ( lockVal != null ) { LockData newLockData = new LockData(currentThread, lockVal); threadData.put(currentThread, newLockData); return true; } return false;
这里每次返回的都获取不到当前线程对应的老锁,应该不会重入吧
The text was updated successfully, but these errors were encountered:
No branches or pull requests
每次获取锁都是new出来的RedisReentrantLock,都是不同的threadData,从里面取出数据应该都是空的,
LockData lockData = threadData.get(currentThread); if ( lockData != null ) { lockData.lockCount.incrementAndGet(); return true; } String lockVal = internals.tryRedisLock(lockId,timeout,unit); if ( lockVal != null ) { LockData newLockData = new LockData(currentThread, lockVal); threadData.put(currentThread, newLockData); return true; } return false;
这里每次返回的都获取不到当前线程对应的老锁,应该不会重入吧
The text was updated successfully, but these errors were encountered: