|
@@ -165,7 +165,11 @@ public class SnatchMaskServiceImpl implements SnatchMaskService {
|
|
|
log.info("线程:{} 获取锁", threadName);
|
|
|
Thread.sleep(3000);
|
|
|
log.info("doSnatch方法执行结果:{}", this.doSnatch(uid, maskId));
|
|
|
- lock.unlock();
|
|
|
+ if (lock.isLocked()) {
|
|
|
+ if (lock.isHeldByCurrentThread()) {
|
|
|
+ lock.unlock();
|
|
|
+ }
|
|
|
+ }
|
|
|
log.info("{}:业务执行完成", threadName);
|
|
|
break;
|
|
|
}
|