mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(net): add NETEVENTQUEUE dtor
This commit is contained in:
parent
93edfe896e
commit
b925836c2c
@ -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();
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user