Exemplo n.º 1
0
        private void ThreadBody()
        {
            ThreadScopedSingleton instance = ThreadScopedSingleton.Instance;

            for (int i = 0; i < TestTimes; i++)
            {
                Assert.IsTrue(instance == ThreadScopedSingleton.Instance);
            }
            registry.Add(instance);
        }
Exemplo n.º 2
0
        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);
        }