コード例 #1
0
        public virtual void TestThreadSafety()
        {
            BaseDirectoryWrapper dir = NewDirectory();

            dir.CheckIndexOnClose = false; // we arent making an index
            if (dir is MockDirectoryWrapper)
            {
                ((MockDirectoryWrapper)dir).Throttling = Throttling.NEVER; // makes this test really slow
            }

            if (VERBOSE)
            {
                Console.WriteLine(dir);
            }

            TheThread  theThread  = new TheThread("t1", dir);
            TheThread2 theThread2 = new TheThread2("t2", dir);

            theThread.Start();
            theThread2.Start();

            theThread.Join();
            theThread2.Join();

            dir.Dispose();
        }
コード例 #2
0
 public TheThread(string name, BaseDirectoryWrapper baseDirectoryWrapper)
 {
     this.name      = name;
     outerBDWrapper = baseDirectoryWrapper;
 }
コード例 #3
0
 public TheThread(string name, BaseDirectoryWrapper baseDirectoryWrapper)
 {
     this.name = name;
     outerBDWrapper = baseDirectoryWrapper;
 }