1
0
mirror of synced 2026-04-27 02:38:39 +08:00

auto commit

This commit is contained in:
yitter
2022-06-06 22:48:35 +08:00
parent 0e6fbe732f
commit 5e24340526
2 changed files with 10 additions and 4 deletions

View File

@@ -41,9 +41,15 @@ namespace Yitter.IdGenerator
{
if (_IdGenInstance == null)
{
_IdGenInstance = new DefaultIdGenerator(
new IdGeneratorOptions() { WorkerId = 0 }
);
lock (_IdGenInstance)
{
if (_IdGenInstance == null)
{
_IdGenInstance = new DefaultIdGenerator(
new IdGeneratorOptions() { WorkerId = 0 }
);
}
}
}
return _IdGenInstance.NewLong();