Пример #1
0
 private void EnqueueReply(ReplyBossMsgExtend reply)
 {
     lock (m_ReplyBossMsgs)
     {
         m_ReplyBossMsgs.Enqueue(reply);
     }
 }
 public static bool CompareMembers(ReplyBossMsgExtend left, ReplyBossMsgExtend right)
 {
     if (left == null || right == null)
     {
         return(false);
     }
     if ((left.ReplyBoss.TaskID != right.ReplyBoss.TaskID) || (left.Type != right.Type))
     {
         return(false);
     }
     return(true);
 }
Пример #3
0
        public bool CheckAlreadyWork(ReplyBossMsgExtend replyExtend)
        {
            bool bAlready = false;

            for (int i = 0; i < RESPONSE_THREADS; i++)
            {
                if (replyExtend.Equals(m_webWrappers[i].CurrentReply))
                {
                    bAlready = true;
                    break;
                }
            }
            return(bAlready);
        }
Пример #4
0
        private void GetReplyBossMsg(string view, ReplyType type)
        {
            DataTable dt = SQLUtil.GetReplyBossMsg(m_Connstr, view);

            if (dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    ReplyBossMsg       reply       = IdlUtil.ParseReplyFromDataRow(dr);
                    ReplyBossMsgExtend replyExtend = new ReplyBossMsgExtend(reply, type);
                    if (!m_ReplyBossMsgs.Contains(replyExtend) && !CheckAlreadyWork(replyExtend))
                    {
                        lock (m_ReplyBossMsgs)
                        {
                            m_ReplyBossMsgs.Enqueue(replyExtend);
                        }
                    }
                }
            }
        }
Пример #5
0
 private void UnlockReply()
 {
     m_currentReply = null;
     Interlocked.Exchange(ref m_replyExist, 0L);
     UnlockDispatch();
 }
Пример #6
0
 public void SetReply(ReplyBossMsgExtend reply)
 {
     m_currentReply = reply;
     Interlocked.Exchange(ref m_replyExist, 1L);
 }