diff options
author | Alexander Larsson <alexl@redhat.com> | 2010-10-12 13:43:44 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2010-10-12 13:43:44 +0200 |
commit | da35f9acd6fd735734a32f3d77f154c11337053b (patch) | |
tree | b1d588749e5625684465c40ff6b0d114d530da49 /client/x11/event_sources_p.h | |
parent | 97f33fa86aa6edd25111b173dc0d9599ac29f879 (diff) | |
download | spice-da35f9acd6fd735734a32f3d77f154c11337053b.tar.gz spice-da35f9acd6fd735734a32f3d77f154c11337053b.tar.xz spice-da35f9acd6fd735734a32f3d77f154c11337053b.zip |
Replace epoll with select in X client
The use of epoll in the client is totally overkill in terms of
scalability, and its a problem for portability. The OSX port converts
this to use select, but keeps some of the old complexities in the code.
This new patch makes it simpler and look much more like the windows
code.
Diffstat (limited to 'client/x11/event_sources_p.h')
-rw-r--r-- | client/x11/event_sources_p.h | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/client/x11/event_sources_p.h b/client/x11/event_sources_p.h index 09703c0e..959460c2 100644 --- a/client/x11/event_sources_p.h +++ b/client/x11/event_sources_p.h @@ -21,24 +21,18 @@ #include "common.h" #include "threads.h" -#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) -#define USING_EVENT_FD -#endif - #define INFINITE -1 -class EventWrapper; +class EventSource; class EventSources_p { -public: - void remove_wrapper(EventWrapper*); +protected: + void add_event(int fd, EventSource* source); + void remove_event(EventSource* source); public: - int _epoll; - typedef std::list<EventWrapper*> Events; - Events _events; - - friend class EventWrapper; + std::vector<EventSource*> _events; + std::vector<int> _fds; }; class Trigger_p { @@ -49,9 +43,7 @@ public: public: int _event_fd; -#ifndef USING_EVENT_FD int _event_write_fd; -#endif bool _pending_int; Mutex _lock; }; |