예제 #1
0
        static void MakeNewThread(SignalServer s)
        {
            Consumer c = new Consumer(s);
            Thread   t = new Thread(c.Run);

            t.Start();
            objects.Add(c);
        }
예제 #2
0
        static void Main(string[] args)
        {
            SignalServer server = new SignalServer();

            objects.Add(server);
            Thread t = new Thread(server.Run);

            t.Start();
            for (int i = 0; i < 10; i++)
            {
                MakeNewThread(server);
            }
            Thread.Sleep(10000);
            Stop();
            Console.WriteLine("Done");
            Console.ReadLine();
        }
예제 #3
0
 public Consumer(SignalServer server)
 {
     signaler = server;
 }