自定义订单
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
package cn.iocoder.yudao.module.member.service.amount;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class LockManager {
|
||||
@ -23,7 +22,7 @@ public class LockManager {
|
||||
|
||||
public static Object getSupermarketLock(Long storeId) {
|
||||
// 对每个 userId 生成独立的锁对象,并发地存储在 ConcurrentHashMap 中
|
||||
return storeLocks.computeIfAbsent(storeId, k -> new Object());
|
||||
return supermarketLocks.computeIfAbsent(storeId, k -> new Object());
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user