Esempio n. 1
0
 private void Actor_OnDoWork(object sender, DoWorkArgs args, EventType eventType, IBook book)
 {
     new Thread(() =>
     {
         semaphore.WaitOne(-1);
         lock (locker)
         {
             using (var writer = GetWriter())
             {
                 OnLog(sender, new OnLogArgs <IBook>()
                 {
                     Args      = args,
                     EventType = eventType,
                     Output    = writer,
                     Sender    = book
                 });
                 //Console.WriteLine(Thread.CurrentThread.ManagedThreadId);
             }
         }
         semaphore.Release();
     })
     {
         IsBackground = true
     }.Start();
 }
Esempio n. 2
0
 private void Actor_OnDoWork(object sender, DoWorkArgs args, EventType eventType, T book)
 {
     using (var writer = GetWriter())
     {
         OnLog(sender, new OnLogArgs <T>()
         {
             Args      = args,
             EventType = eventType,
             Output    = writer,
             Sender    = book
         });
     }
 }