Beispiel #1
0
        public void sendRequest(int log)
        {
            Prin ev = new Prin();

            ev.log = log;
            OnProc(ev);
        }
Beispiel #2
0
 public void proc(object sender, Prin e)
 {
     lock (threadLock)
     {
         Console.WriteLine("Application with a number: {0}", e.log);
         appeal++;
         for (int i = 0; i < n; ++i)
         {
             if (pool[i].use == false)
             {
                 pool[i].wait++;
             }
         }
         for (int i = 0; i < n; i++)
         {
             if (!pool[i].use)
             {
                 pool[i].count++;
                 pool[i].use    = true;
                 pool[i].thread = new Thread(new ParameterizedThreadStart(Answer));
                 pool[i].thread.Start(e.log);
                 treated++;
                 return;
             }
         }
         outlaw++;
     }
 }
Beispiel #3
0
 protected virtual void OnProc(Prin e)
 {
     request?.Invoke(this, e);
 }