Move named channel code to the thread module instead of having a static map. Fixes issue #1464.

This commit is contained in:
Alex Szpakowski
2018-12-31 22:36:36 -04:00
parent 364718fa46
commit 19890a65c3
5 changed files with 16 additions and 60 deletions
-6
View File
@@ -23,7 +23,6 @@
// STL
#include <queue>
#include <string>
// LOVE
#include "common/Variant.h"
@@ -47,8 +46,6 @@ public:
Channel();
~Channel();
static Channel *getChannel(const std::string &name);
uint64 push(const Variant &var);
bool supply(const Variant &var); // blocking push
bool supply(const Variant &var, double timeout);
@@ -62,15 +59,12 @@ public:
private:
Channel(const std::string &name);
void lockMutex();
void unlockMutex();
MutexRef mutex;
ConditionalRef cond;
std::queue<Variant> queue;
bool named;
std::string name;
uint64 sent;
uint64 received;