Ykkrosh
027c3c7cc0
Use a name that works on Linux. Try several random names to avoid conflicts with other processes. This was SVN commit r5315.
27 lines
581 B
C++
27 lines
581 B
C++
#include "MessagePasser.h"
|
|
|
|
#include "ps/ThreadUtil.h"
|
|
#include "ps/CStr.h"
|
|
#include <queue>
|
|
|
|
class MessagePasserImpl : public AtlasMessage::MessagePasser, boost::noncopyable
|
|
{
|
|
public:
|
|
MessagePasserImpl();
|
|
~MessagePasserImpl();
|
|
virtual void Add(AtlasMessage::IMessage* msg);
|
|
virtual AtlasMessage::IMessage* Retrieve();
|
|
virtual void Query(AtlasMessage::QueryMessage* qry, void(*timeoutCallback)());
|
|
|
|
bool IsEmpty();
|
|
|
|
void SetTrace(bool t);
|
|
|
|
private:
|
|
CMutex m_Mutex;
|
|
CStr m_SemaphoreName;
|
|
sem_t* m_Semaphore;
|
|
std::queue<AtlasMessage::IMessage*> m_Queue;
|
|
bool m_Trace;
|
|
};
|