Fixed poll timeout bug

The SIGCONT signal was being ignored by the HRT queue thread so the
usleep was not waking up early to process new work.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
Mark Charlebois
2015-09-16 15:24:58 -07:00
parent 6feaccca78
commit 7d2ba97511
3 changed files with 38 additions and 4 deletions
+3 -3
View File
@@ -195,7 +195,7 @@ int px4_poll(px4_pollfd_struct_t *fds, nfds_t nfds, int timeout)
{
sem_t sem;
int count = 0;
int ret;
int ret = -1;
unsigned int i;
PX4_DEBUG("Called px4_poll timeout = %d", timeout);
@@ -222,7 +222,7 @@ int px4_poll(px4_pollfd_struct_t *fds, nfds_t nfds, int timeout)
if (ret >= 0)
{
if (timeout >= 0)
if (timeout > 0)
{
// Use a work queue task
work_s _hpwork;
@@ -234,7 +234,7 @@ int px4_poll(px4_pollfd_struct_t *fds, nfds_t nfds, int timeout)
// out of scope
hrt_work_cancel(&_hpwork);
}
else
else if (timeout < 0)
{
sem_wait(&sem);
}