Пример #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;
 }