public void Enqueue(InvokeEventClass item) { lock (_lock) { myQueue.Enqueue(item); } }
public ImFriendBlackListNotify(object Parser) { uint parser = (uint)Parser; userInfoList = new List <xUserInfo>(); userInfoList = InsertUserInfo(parser); InvokeEventClass myFriendList = new InvokeEventClass(ProtocolEnum.IM_FRIEND_BLACKLIST_NOTIFY, this); YunVaImInterface.eventQueue.Enqueue(myFriendList); }
void Update() { if (eventQueue.GetData(tmpQ)) { while (tmpQ.Count > 0) { InvokeEventClass obj = tmpQ.Dequeue(); EventListenerManager.Invoke(obj.eventType, obj.dataObj); } } }
public bool GetData(Queue <InvokeEventClass> outQ) { lock (_lock) { int count = myQueue.Count; if (count == 0) { return(false); } for (int i = 0; i < count; i++) { InvokeEventClass obj = myQueue.Dequeue(); outQ.Enqueue(obj); } return(true); } }