定时任务支持并发控制

This commit is contained in:
RuoYi
2019-03-13 19:45:12 +08:00
parent 9fc42511c6
commit e34b4ea63d
24 changed files with 430 additions and 300 deletions

View File

@ -22,7 +22,7 @@ public class Global
/**
* 当前对象实例
*/
private static Global global = null;
private static Global global;
/**
* 保存全局属性值
@ -34,18 +34,13 @@ public class Global
}
/**
* 静态工厂方法 获取当前对象实例 多线程安全单例模式(使用双重同步锁)
* 静态工厂方法
*/
public static synchronized Global getInstance()
{
if (global == null)
{
synchronized (Global.class)
{
if (global == null)
global = new Global();
}
global = new Global();
}
return global;
}