All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.kqinfo.universal.redis.util.LockContext Maven / Gradle / Ivy

package com.kqinfo.universal.redis.util;

import org.springframework.core.NamedThreadLocal;

/**
 * @author Zijian Liao
 * @since 2.3.0
 */
public class LockContext {

    private static final NamedThreadLocal context = new NamedThreadLocal<>("lock context");

    public static Boolean getAndRemove(){
        Boolean b = context.get();
        context.remove();
        return b;
    }

    public static void setSuccess(){
        context.set(Boolean.TRUE);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy