protected void Wait(ConditionalVar condVar)
 {
     Logger.LogWait(Communicator.MyRank, _syncEntryNumber, Communicator.Clock);
     condVar.WaitingQueue.Add(Communicator.MyRank);
     AckDeferredMessages();
     Waiting();
     //add 1, it has to count as new entry
     _syncEntryNumber++;
 }
        protected void Signal(ConditionalVar condVar)
        {
            if (condVar.WaitingQueue.Any())
            {
                int destinationProc = condVar.WaitingQueue[0];
                condVar.WaitingQueue.RemoveAt(0);
                var msg = BuildCurrentMonitorMessage();
                Logger.LogPreSignal(Communicator.MyRank, destinationProc, _syncEntryNumber, Communicator.Clock);
                Communicator.Send(msg, destinationProc, Tags.WAKE_TAG);
                Communicator.Broadcast(msg, Tags.PRIORITY_REQ_TAG);
                PriorityRequesting();

                //add 1, it has to count as new entry
                _syncEntryNumber++;
                Logger.LogAfterSignalInCS(Communicator.MyRank, _syncEntryNumber, Communicator.Clock);
            }
        }