Beispiel #1
0
 public static Hairmaker Instance()
 {
     if (hairmaker == null)
     {
         hairmaker = new Hairmaker();
     }
     return(hairmaker);
 }
Beispiel #2
0
        static void Main(string[] args)
        {
            var hairmak         = Hairmaker.Instance();
            var hairmakerThread = new Thread(hairmak.Cut);

            hairmakerThread.Start();

            Thread[] clients = new Thread[Hairmaker.Name.Length];

            for (int i = 0; i < clients.Length; i++)
            {
                Thread.Sleep(Hairmaker.random.Next(100, 4000));
                clients[i]      = new Thread(hairmak.Client);
                clients[i].Name = Hairmaker.Name[i];
                clients[i].Start();
            }
            Console.ReadLine();
        }