private void ThreadBody() { ThreadScopedSingleton instance = ThreadScopedSingleton.Instance; for (int i = 0; i < TestTimes; i++) { Assert.IsTrue(instance == ThreadScopedSingleton.Instance); } registry.Add(instance); }
void ThreadBody() { ThreadScopedSingleton instance = ThreadScopedSingleton.Instance; for (int i = 0; i < TestTime; i++) { Assert.IsTrue(instance == ThreadScopedSingleton.Instance); Trace.WriteLine("instance:" + instance.GetHashCode()); Trace.WriteLine("ThreadScopedSingleton:" + ThreadScopedSingleton.Instance.GetHashCode()); } registry.Add(instance); }