From da35f9acd6fd735734a32f3d77f154c11337053b Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 12 Oct 2010 13:43:44 +0200 Subject: 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. --- client/x11/event_sources_p.h | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'client/x11/event_sources_p.h') 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 Events; - Events _events; - - friend class EventWrapper; + std::vector _events; + std::vector _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; }; -- cgit