コード例 #1
0
ファイル: MutexTest.cs プロジェクト: zhufengGNSS/mono
        public void TestWaitAndFoget1()
        {
            Mutex         Sem     = new Mutex(false);
            ConcClassLoop class1  = new ConcClassLoop(1, Sem);
            ConcClassLoop class2  = new ConcClassLoop(2, Sem);
            Thread        thread1 = new Thread(new ThreadStart(class1.WaitAndForget));
            Thread        thread2 = new Thread(new ThreadStart(class2.WaitAndForget));

            try {
                thread1.Start();
                TestUtil.WaitForNotAlive(thread1, "t1");

                thread2.Start();
                TestUtil.WaitForNotAlive(thread2, "t2");

                Assert.AreEqual(class2.id, class2.marker);
            } finally {
#if MONO_FEATURE_THREAD_ABORT
                thread1.Abort();
                thread2.Abort();
#else
                thread1.Interrupt();
                thread2.Interrupt();
#endif
            }
        }
コード例 #2
0
        public void TestWaitAndSignal1()
        {
            Mutex         Sem     = new Mutex(false);
            ConcClassLoop class1  = new ConcClassLoop(1, Sem);
            Thread        thread1 = new Thread(new ThreadStart(class1.Loop));

            try {
                thread1.Start();
                TestUtil.WaitForNotAlive(thread1, "");
                Assert.AreEqual(100, class1.marker);
            } finally {
                thread1.Abort();
            }
        }
コード例 #3
0
ファイル: MutexTest.cs プロジェクト: zhufengGNSS/mono
        public void TestWaitAndSignal1()
        {
            Mutex         Sem     = new Mutex(false);
            ConcClassLoop class1  = new ConcClassLoop(1, Sem);
            Thread        thread1 = new Thread(new ThreadStart(class1.Loop));

            try {
                thread1.Start();
                TestUtil.WaitForNotAlive(thread1, "");
                Assert.AreEqual(100, class1.marker);
            } finally {
#if MONO_FEATURE_THREAD_ABORT
                thread1.Abort();
#else
                thread1.Interrupt();
#endif
            }
        }
コード例 #4
0
        public void TestWaitAndFoget1()
        {
            Mutex         Sem     = new Mutex(false);
            ConcClassLoop class1  = new ConcClassLoop(1, Sem);
            ConcClassLoop class2  = new ConcClassLoop(2, Sem);
            Thread        thread1 = new Thread(new ThreadStart(class1.WaitAndForget));
            Thread        thread2 = new Thread(new ThreadStart(class2.WaitAndForget));

            try {
                thread1.Start();
                TestUtil.WaitForNotAlive(thread1, "t1");

                thread2.Start();
                TestUtil.WaitForNotAlive(thread2, "t2");

                Assert.AreEqual(class2.id, class2.marker);
            } finally {
                thread1.Abort();
                thread2.Abort();
            }
        }
コード例 #5
0
ファイル: MutexTest.cs プロジェクト: nlhepler/mono
		public void TestWaitAndFoget1()
		{
			Mutex Sem = new Mutex(false);
			ConcClassLoop class1 = new ConcClassLoop(1,Sem);
			ConcClassLoop class2 = new ConcClassLoop(2,Sem);
			Thread thread1 = new Thread(new ThreadStart(class1.WaitAndForget));
			Thread thread2 = new Thread(new ThreadStart(class2.WaitAndForget));
			
			try {
				thread1.Start();
				TestUtil.WaitForNotAlive (thread1, "t1");
	
				thread2.Start();
				TestUtil.WaitForNotAlive (thread2, "t2");
			
				Assert.AreEqual (class2.id, class2.marker);
			} finally {
				thread1.Abort ();
				thread2.Abort ();
			}
		}
コード例 #6
0
ファイル: MutexTest.cs プロジェクト: nlhepler/mono
		public void TestWaitAndSignal1()
		{
			Mutex Sem = new Mutex (false);
			ConcClassLoop class1 = new ConcClassLoop (1, Sem);
			Thread thread1 = new Thread (new ThreadStart (class1.Loop));
			try {
				thread1.Start ();
				TestUtil.WaitForNotAlive (thread1, "");
				Assert.AreEqual (100, class1.marker);
			} finally {
				thread1.Abort ();
			}
		}
コード例 #7
0
ファイル: MutexTest.cs プロジェクト: Profit0004/mono
		public void TestWaitAndFoget1()
		{
			Mutex Sem = new Mutex(false);
			ConcClassLoop class1 = new ConcClassLoop(1,Sem);
			ConcClassLoop class2 = new ConcClassLoop(2,Sem);
			Thread thread1 = new Thread(new ThreadStart(class1.WaitAndForget));
			Thread thread2 = new Thread(new ThreadStart(class2.WaitAndForget));
			
			try {
				thread1.Start();
				TestUtil.WaitForNotAlive (thread1, "t1");
	
				thread2.Start();
				TestUtil.WaitForNotAlive (thread2, "t2");
			
				Assert.AreEqual (class2.id, class2.marker);
			} finally {
#if MONO_FEATURE_THREAD_ABORT
				thread1.Abort ();
				thread2.Abort ();
#else
				thread1.Interrupt ();
				thread2.Interrupt ();
#endif
			}
		}
コード例 #8
0
ファイル: MutexTest.cs プロジェクト: Profit0004/mono
		public void TestWaitAndSignal1()
		{
			Mutex Sem = new Mutex (false);
			ConcClassLoop class1 = new ConcClassLoop (1, Sem);
			Thread thread1 = new Thread (new ThreadStart (class1.Loop));
			try {
				thread1.Start ();
				TestUtil.WaitForNotAlive (thread1, "");
				Assert.AreEqual (100, class1.marker);
			} finally {
#if MONO_FEATURE_THREAD_ABORT
				thread1.Abort ();
#else
				thread1.Interrupt ();
#endif
			}
		}