package com.sifang.modules.taskdispatch.service;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.ReentrantLock;

public class SimpleLock {

    private static final Map<String, ReentrantLock> locks = new ConcurrentHashMap<>();

    public static ReentrantLock getLock(String id) {
        return locks.computeIfAbsent(id, k -> new ReentrantLock());
    }

}
