When the system remains idle i.e. there is no exchange of data then
poll would be called repeatedly very fast.some of the fields/parameters
inside poll are not getting set/reset by kernel on calling repeatedly.
So applying a sleep whenever poll gets timed out.
https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/585
(cherry-picked from
4cc2d76d5835a4ccb9d7a7569376e8d0938db264)
Change-Id: I33dca282cdc9406d543b8f887bb8a5f576b7f4b3
Signed-off-by: sourav bhuwalka <s.bhuwalka@samsung.com>
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
}
}
oc_mutex_unlock(g_mutexObjectList);
-
int ret = poll(readFds, counter, timeout);
oc_mutex_lock(g_mutexObjectList);
{
CAPollReturned(readFds, counter);
}
+ else if (ret == 0)
+ {
+ usleep(1000); /* some of the fields are not set by kernel on repeatedly calling
+ poll.Applying a timeout will solve this*/
+ }
else if (ret < 0)
{
OIC_LOG_V(FATAL, TAG, "poll error %s", strerror(errno));