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); }
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); }
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); } } } } }
private void UnlockReply() { m_currentReply = null; Interlocked.Exchange(ref m_replyExist, 0L); UnlockDispatch(); }
public void SetReply(ReplyBossMsgExtend reply) { m_currentReply = reply; Interlocked.Exchange(ref m_replyExist, 1L); }