protected final boolean tryAcquire(int acquires) {
//当前线程
Thread current = Thread.currentThread();
//获取同步状态
int c = getState();
//写线程数量
int w = exclusiveCount(c);
//当前同步状态c != 0,说明其他线程获取了读锁或写锁
if (c != 0) {
//存在读锁或当前线程不是持有写锁的线程
if (w == 0 || current != getExclusiveOwnerThread())
return false;
//判断同一线程获取写锁是否超过最大次数(65535)
if (w + exclusiveCount(acquires) > MAX_COUNT)
throw new Error("Maximum lock count exceeded");