From c8933e4c7182273f09db96b833735596a5fb365f Mon Sep 17 00:00:00 2001 From: Hasnain Virk Date: Wed, 10 May 2017 12:09:36 +0300 Subject: [PATCH] Removing _poll_change() for now There is currently no proper wake up mechanism provided by mbed-os. _poll_change() was supposed to wake upa blocking poll() in case of a POLL event but the implementation was dependent upon underlying wake up mechanism. In the absence of conditioanl variables or some other alternative, _poll_change() wasn't able to serve its purpose. Removing it for now. Should be implemented at some later stage --- platform/BufferedSerial.cpp | 1 - platform/FileHandle.cpp | 1 + platform/FileHandle.h | 3 +-- platform/mbed_poll.cpp | 5 ----- platform/mbed_poll.h | 6 ------ 5 files changed, 2 insertions(+), 14 deletions(-) diff --git a/platform/BufferedSerial.cpp b/platform/BufferedSerial.cpp index 99ca8527f0..6c2401be84 100644 --- a/platform/BufferedSerial.cpp +++ b/platform/BufferedSerial.cpp @@ -178,7 +178,6 @@ bool BufferedSerial::hup() const void BufferedSerial::wake() { - _poll_change(this); if (_sigio_cb) { _sigio_cb(); } diff --git a/platform/FileHandle.cpp b/platform/FileHandle.cpp index df72616993..026b11d9ce 100644 --- a/platform/FileHandle.cpp +++ b/platform/FileHandle.cpp @@ -32,6 +32,7 @@ off_t FileHandle::size() seek(off, SEEK_SET); return size; } + std::FILE *fdopen(FileHandle *fh, const char *mode) { return mbed_fdopen(fh, mode); diff --git a/platform/FileHandle.h b/platform/FileHandle.h index 5123cbde2b..3a3afbc31f 100644 --- a/platform/FileHandle.h +++ b/platform/FileHandle.h @@ -181,8 +181,7 @@ public: * The input parameter can be used or ignored - the could always return all events, * or could check just the events listed in events. * Call is non-blocking - returns instantaneous state of events. - * Whenever an event occurs, the derived class must call _poll_change() (as well as - * the sigio() callback). + * Whenever an event occurs, the derived class should call the sigio() callback). * * @param events bitmask of poll events we're interested in - POLLIN/POLLOUT etc. * diff --git a/platform/mbed_poll.cpp b/platform/mbed_poll.cpp index 41e4bf1f22..28492010d4 100644 --- a/platform/mbed_poll.cpp +++ b/platform/mbed_poll.cpp @@ -72,9 +72,4 @@ int poll(pollfh fhs[], unsigned nfhs, int timeout) return count; } -void _poll_change(FileHandle *fh) -{ - // TODO, will depend on how we implement poll -} - } // namespace mbed diff --git a/platform/mbed_poll.h b/platform/mbed_poll.h index 3aea995d6e..6df32529e1 100644 --- a/platform/mbed_poll.h +++ b/platform/mbed_poll.h @@ -49,12 +49,6 @@ struct pollfh { */ int poll(pollfh fhs[], unsigned nfhs, int timeout); -/** To be called by device when poll state changes - must be called for poll() to work - * This must be called in addition to the user-provided callback. - * - * @param fh A pointer to the file handle*/ -void _poll_change(FileHandle *fh); - } // namespace mbed #endif //MBED_POLL_H