积累: .net里有个线程安全的int+1类

 Interlocked.Increment(ref id); 
原文地址:https://www.cnblogs.com/MartinLee/p/7622540.html