Holger Waechtler wrote:
> ...
The entire idea of caching pasttime events in a ringbuffer was bogus,
do you know any use for this? Your code contains a race condition
that can show up at particular combinations of CPU speed and status
update rates. Maybe only a theoretical one but in any case an example
for bad programming.
The correct implementation is this:
while (!exit) {
select(fd, ...);
ioctl(fd, FE_READ_STATUS, &status);
/* process/display status */
};
Select what? If the driver sees an event so it can wake up poll(),
it surely can generate a frontend event, no?
Certainly it is valid to call FE_READ_STATUS instead of looking
at the event retrieved with FE_GET_EVENT, but the API guarantees
that FE_GET_EVENT will also give you the tuning status.
a pasttime event, yes. But who cares about the lockbit status some
while ago?
Holger
Back when I did some experimenting in that area it looked as if
FE_READ_STATUS would return an FE_HAS_LOCK _immediately_ after tuning
(presumably
the status bits were still at the value they had vefore tuning),