protected override void Process() { UpdateLog("Loading"); Log = ""; IO.PCD_Importer Importer = new IO.PCD_Importer(); try { RWL.AcquireWriterLock(100); try { Importer.Import(Path, out Cloud, Intensity); } finally { RWL.ReleaseWriterLock(); } } catch (Exception) { UpdateLog("Error."); } Log += Importer.log; base.Process(); }
public virtual void Leave(Presence sender) { try { RWL.AcquireWriterLock(50); Values.Remove(sender.Token); } finally { RWL.ReleaseWriterLock(); } }
public virtual void Join(Presence sender) { try { RWL.AcquireWriterLock(50); Values[sender.Token] = sender; } finally { RWL.ReleaseWriterLock(); } }
protected override void Run() { while (true) { using (RWL.AcquireWriterLock()){ Console.WriteLine("<< " + base.ToString() + " is writing"); Thread.Sleep(3000); Console.WriteLine(">> " + base.ToString() + " has finished writing"); } // Thread.Sleep (1000); } }