コード例 #1
0
        public void Setup()
        {
            lazyMultiThreaded = LazyFactory <int> .CreateMultiThreadedLazy(() =>
            {
                for (int i = 0; i < 100000; i++)
                {
                    Interlocked.Increment(ref result);
                }
                return(result);
            });

            threads = new Thread[5];
            for (int i = 0; i < 5; i++)
            {
                threads[i] = new Thread(() => lazyMultiThreaded.Get());
            }
        }
コード例 #2
0
 public void NullFunctionTesting()
 {
     Assert.Throws <ArgumentNullException> (() => LazyFactory <int> .CreateMultiThreadedLazy(null));
 }