Пример #1
0
        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();
        }
Пример #2
0
 public virtual void Leave(Presence sender)
 {
     try
     {
         RWL.AcquireWriterLock(50);
         Values.Remove(sender.Token);
     }
     finally
     {
         RWL.ReleaseWriterLock();
     }
 }
Пример #3
0
 public virtual void Join(Presence sender)
 {
     try
     {
         RWL.AcquireWriterLock(50);
         Values[sender.Token] = sender;
     }
     finally
     {
         RWL.ReleaseWriterLock();
     }
 }
Пример #4
0
            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);
                }
            }