public static void RemoveLock(ThreadLock objThreadLock)
 {
     lock (ThreadLock.LOCKOBJECT)
     {
         lockTable.Remove(objThreadLock);
     }
 }
Exemplo n.º 2
0
        public void SetThreadLock(ThreadLock objLockInfo, ctrlThreadActivity ctrlParent)
        {
            this.objLockInfo = objLockInfo;
            this.ctrlParent = ctrlParent;
            ctrlParent.DisplaySimilarRecordsEvent += new ctrlThreadActivity.DisplaySimilarRecordsByObject(ctrlParent_DisplaySimilarRecordsEvent);
            int totalTime = objLockInfo.nEnd - objLockInfo.nStart;

         

            float oneMSEquals = ctrlThreadActivity.pixel / ctrlThreadActivity.millisecond;

            label1.Width = (int)((objLockInfo.nAcquired - objLockInfo.nStart) * oneMSEquals);
            label2.Width = (int)((objLockInfo.nEnd - objLockInfo.nAcquired) * oneMSEquals);

            label1.Location = new Point(0, 0);
            label2.Location = new Point(label1.Width, 0);
            this.Size = new Size(label2.Location.X + label2.Width, this.Height);

           // toolTip1.InitialDelay = 0;
            
           // toolTip1.IsBalloon = true;
           // toolTip1.SetToolTip(label1, (objLockInfo.nAcquired - objLockInfo.nStart).ToString());
          //  toolTip1.SetToolTip(label2, "Hi");
            

        }
 public static int PutLock(ThreadLock objThreadLock, object objLock)
 {
     lock (ThreadLock.LOCKOBJECT)
     {
         lockTable[objThreadLock] = objLock;
         if (ThreadLock.enableIndividualThreadActivityScaning)
             return id++;
         else return 0;
     }
 }