Fixed bug that could allow multiple threads to simultaneously access

the X11 display connection.  The only problematic method was
CXWindowsEventQueueBuffer::addEvent given that the other event queue
methods are only called from the main thread.
This commit is contained in:
crs
2004-05-18 20:26:48 +00:00
parent 7e36454b01
commit 88c6769ebe
2 changed files with 62 additions and 7 deletions

View File

@@ -16,6 +16,8 @@
#define CXWINDOWSEVENTQUEUEBUFFER_H
#include "IEventQueueBuffer.h"
#include "CMutex.h"
#include "stdvector.h"
#if defined(X_DISPLAY_MISSING)
# error X11 is required to build synergy
#else
@@ -38,10 +40,18 @@ public:
virtual void deleteTimer(CEventQueueTimer*) const;
private:
void flush();
private:
typedef std::vector<XEvent> CEventList;
CMutex m_mutex;
Display* m_display;
Window m_window;
Atom m_userEvent;
XEvent m_event;
CEventList m_postedEvents;
bool m_waiting;
};
#endif