mirror of
https://github.com/whoahq/whoa.git
synced 2026-11-08 15:49:54 +03:00
feat(net): add NETEVENTQUEUE dtor
This commit is contained in:
2 files changed
+14
No files matched your search
@@ -20,6 +20,10 @@ void InitializePropContext() {
|
||||
}
|
||||
}
|
||||
|
||||
NETEVENTQUEUE::~NETEVENTQUEUE() {
|
||||
this->Clear();
|
||||
}
|
||||
|
||||
void NETEVENTQUEUE::AddEvent(EVENTID eventId, void* conn, NetClient* client, const void* data, uint32_t bytes) {
|
||||
this->m_critSect.Enter();
|
||||
|
||||
@@ -43,6 +47,14 @@ void NETEVENTQUEUE::AddEvent(EVENTID eventId, void* conn, NetClient* client, con
|
||||
this->m_critSect.Leave();
|
||||
}
|
||||
|
||||
void NETEVENTQUEUE::Clear() {
|
||||
this->m_critSect.Enter();
|
||||
|
||||
this->m_eventQueue.Clear();
|
||||
|
||||
this->m_critSect.Leave();
|
||||
}
|
||||
|
||||
void NETEVENTQUEUE::Poll() {
|
||||
this->m_critSect.Enter();
|
||||
|
||||
|
||||
@@ -41,7 +41,9 @@ class NETEVENTQUEUE {
|
||||
NETEVENTQUEUE(NetClient* client)
|
||||
: m_client(client)
|
||||
{};
|
||||
~NETEVENTQUEUE();
|
||||
void AddEvent(EVENTID eventId, void* conn, NetClient* client, const void* data, uint32_t bytes);
|
||||
void Clear();
|
||||
void Poll();
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user