Beispiel #1
0
 public void Add(string Key, JobBaseList Value)
 {
     WaitHandle.WaitAll(this.reads);
     this.write.Reset();
     this.Jobs.Add(Key, Value);
     this.write.Set();
 }
Beispiel #2
0
 public void Add(string Key, JobBaseList Value)
 {
     WaitHandle.WaitAll(this.reads);
     this.write.Reset();
     this.Jobs.Add(Key, Value);
     this.write.Set();
 }
Beispiel #3
0
 public JobBaseList this[string Key]
 {
     get
     {
         //1:write信号阻止,没有调用write.Set之前
         //2:reads[1]回滚到默认的初始false阻塞线程状态
         //3:reads[1]释放线程阻塞
         this.write.WaitOne();
         this.reads[1].Reset();
         JobBaseList one = this.Jobs[Key];
         this.reads[1].Set();
         return(one);
     }
 }
Beispiel #4
0
        public string GetJobInfo(string jobClass, int configid)
        {
            WaitHandle.WaitAll(this.writes);
            this.reads[2].Reset();
            string jobInfo = "";

            foreach (JobBase job in this.bases)
            {
                if (configid == job.ConfigId)
                {
                    jobInfo = JobBaseList.info(job);
                }
            }
            this.reads[2].Set();
            return(jobInfo);
        }