Moved the thread out of the NetworkQueue class
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#ifndef NETWORKQUEUE_HPP_
|
||||
#define NETWORKQUEUE_HPP_
|
||||
|
||||
#include "udp_network_utility.hpp"
|
||||
#include "network_packet.hpp"
|
||||
|
||||
#include "SDL/SDL_thread.h"
|
||||
@@ -10,28 +9,20 @@
|
||||
|
||||
class NetworkQueue {
|
||||
public:
|
||||
NetworkQueue() = default;
|
||||
~NetworkQueue() = default;
|
||||
|
||||
void Init(UDPNetworkUtility*);
|
||||
void Quit();
|
||||
void Kill();
|
||||
NetworkQueue();
|
||||
~NetworkQueue();
|
||||
|
||||
NetworkPacket Push(NetworkPacket);
|
||||
NetworkPacket Peek();
|
||||
NetworkPacket Pop();
|
||||
void Flush();
|
||||
|
||||
int Size();
|
||||
|
||||
SDL_sem* GetLock() const { return lock; }
|
||||
private:
|
||||
friend int networkQueueThread(void*);
|
||||
void ResetMembers();
|
||||
|
||||
bool running = false;
|
||||
|
||||
UDPNetworkUtility* netUtil = nullptr;
|
||||
SDL_sem* lock = nullptr;
|
||||
SDL_Thread* thread = nullptr;
|
||||
std::deque<NetworkPacket> queue;
|
||||
SDL_sem* lock;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user