Beispiel #1
0
        public void SimpleThreadTestMethod()
        {
            SimpleThread testThread = new SimpleThread();
            bool         result     = testThread.Show();

            Assert.IsTrue(result);
        }
Beispiel #2
0
 public static void Main(String[] args)
 {
     SimpleThread a = new SimpleThread("A");
     SimpleThread b = new SimpleThread("B");
     Thread athread = new Thread(new ThreadStart(a.run));
     Thread bthread = new Thread(new ThreadStart(b.run));
     athread.Start();
     bthread.Start();
     athread.Join();
     bthread.Join();
 }
Beispiel #3
0
    public void Execute()
    {
        SimpleThread simple = new SimpleThread();
        Thread       thrd1  = new Thread(new ThreadStart(simple.Process));

        thrd1.Start();

        Thread thrd2 = new Thread(new ThreadStart(simple.Process));

        thrd2.Start();
    }
Beispiel #4
0
    public static void Main(String[] args)
    {
        SimpleThread a       = new SimpleThread("A");
        SimpleThread b       = new SimpleThread("B");
        Thread       athread = new Thread(new ThreadStart(a.run));
        Thread       bthread = new Thread(new ThreadStart(b.run));

        athread.Start();
        bthread.Start();
        athread.Join();
        bthread.Join();
    }
Beispiel #5
0
        static void Main(string[] args)
        {
            SimpleThread simpleThread = new SimpleThread();

            simpleThread.CreateThreadNoParam();
            simpleThread.CreateThreadWithParam("Hello, Thread With Param");
            int tid = simpleThread.ThreadNoParam.ManagedThreadId;

            Console.WriteLine(tid);
            ThreadState state = simpleThread.ThreadNoParam.ThreadState;

            Console.WriteLine(state);
        }
Beispiel #6
0
    public static void Main()
    {
        SimpleThread a = new SimpleThread("Thread A");
        SimpleThread b = new SimpleThread("Thread B");

        Thread aThread = new Thread(a.Run);
        Thread bThread = new Thread(b.Run);

        aThread.Start();
        bThread.Start();
        aThread.Join();
        bThread.Join();
    }