Index: runtime/bin/eventhandler_linux.h |
diff --git a/runtime/bin/eventhandler_linux.h b/runtime/bin/eventhandler_linux.h |
index bec36ce3ece8c0ab112384f29f23b027a4cda344..f5386c34fbca8a1808a12ae8e5ace1899759f223 100644 |
--- a/runtime/bin/eventhandler_linux.h |
+++ b/runtime/bin/eventhandler_linux.h |
@@ -20,80 +20,26 @@ |
namespace dart { |
namespace bin { |
-class InterruptMessage { |
- public: |
- intptr_t id; |
- Dart_Port dart_port; |
- int64_t data; |
-}; |
- |
- |
-class SocketData { |
- public: |
- explicit SocketData(intptr_t fd) |
- : tracked_by_epoll_(false), fd_(fd), port_(0) { |
- ASSERT(fd_ != -1); |
- } |
- |
- void ShutdownRead() { |
- shutdown(fd_, SHUT_RD); |
- } |
- |
- void ShutdownWrite() { |
- shutdown(fd_, SHUT_WR); |
- } |
- |
- void Close() { |
- port_ = 0; |
- close(fd_); |
- fd_ = -1; |
- } |
- |
- void SetPort(Dart_Port port) { |
- ASSERT(fd_ != -1); |
- port_ = port; |
- } |
- |
- intptr_t fd() { return fd_; } |
- Dart_Port port() { return port_; } |
- bool tracked_by_epoll() { return tracked_by_epoll_; } |
- void set_tracked_by_epoll(bool value) { tracked_by_epoll_ = value; } |
- |
- private: |
- bool tracked_by_epoll_; |
- intptr_t fd_; |
- Dart_Port port_; |
-}; |
- |
- |
class EventHandlerImplementation { |
public: |
EventHandlerImplementation(); |
~EventHandlerImplementation(); |
- // Gets the socket data structure for a given file |
- // descriptor. Creates a new one if one is not found. |
- SocketData* GetSocketData(intptr_t fd, bool* is_new); |
- void SendData(intptr_t id, Dart_Port dart_port, int64_t data); |
+ void Notify(intptr_t id, Dart_Port dart_port, int64_t data); |
void Start(EventHandler* handler); |
void Shutdown(); |
private: |
void HandleEvents(struct epoll_event* events, int size); |
static void Poll(uword args); |
- void WakeupHandler(intptr_t id, Dart_Port dart_port, int64_t data); |
- void HandleInterruptFd(); |
void SetPort(intptr_t fd, Dart_Port dart_port, intptr_t mask); |
- intptr_t GetPollEvents(intptr_t events, SocketData* sd); |
- static void* GetHashmapKeyFromFd(intptr_t fd); |
- static uint32_t GetHashmapHashFromFd(intptr_t fd); |
+ intptr_t GetPollEvents(intptr_t events); |
- HashMap socket_map_; |
TimeoutQueue timeout_queue_; |
bool shutdown_; |
- int interrupt_fds_[2]; |
int epoll_fd_; |
int timer_fd_; |
+ Mutex timer_mutex_; |
}; |
} // namespace bin |