diff --git a/C#.NET/source/Yitter.IdGenerator/YitIdHelper.cs b/C#.NET/source/Yitter.IdGenerator/YitIdHelper.cs index f53f6c7..5633df3 100644 --- a/C#.NET/source/Yitter.IdGenerator/YitIdHelper.cs +++ b/C#.NET/source/Yitter.IdGenerator/YitIdHelper.cs @@ -39,18 +39,18 @@ namespace Yitter.IdGenerator /// public static long NextId() { - if (_IdGenInstance == null) - { - lock (_IdGenInstance) - { - if (_IdGenInstance == null) - { - _IdGenInstance = new DefaultIdGenerator( - new IdGeneratorOptions() { WorkerId = 0 } - ); - } - } - } + //if (_IdGenInstance == null) + //{ + // lock (_IdGenInstance) + // { + // if (_IdGenInstance == null) + // { + // _IdGenInstance = new DefaultIdGenerator( + // new IdGeneratorOptions() { WorkerId = 0 } + // ); + // } + // } + //} return _IdGenInstance.NewLong(); } diff --git a/Java/source/src/main/java/com/github/yitter/idgen/YitIdHelper.java b/Java/source/src/main/java/com/github/yitter/idgen/YitIdHelper.java index 31b6005..868ce02 100644 --- a/Java/source/src/main/java/com/github/yitter/idgen/YitIdHelper.java +++ b/Java/source/src/main/java/com/github/yitter/idgen/YitIdHelper.java @@ -34,9 +34,9 @@ public class YitIdHelper { * @return */ public static long nextId() throws IdGeneratorException { - if (idGenInstance == null) { - idGenInstance = new DefaultIdGenerator(new IdGeneratorOptions((short) 1)); - } + //if (idGenInstance == null) { + // idGenInstance = new DefaultIdGenerator(new IdGeneratorOptions((short) 1)); + //} return idGenInstance.newLong(); }