diff options
author | David Herrmann <[email protected]> | 2012-06-10 15:16:15 +0200 |
---|---|---|
committer | Jiri Kosina <[email protected]> | 2012-06-18 13:42:00 +0200 |
commit | 1f9dec1e0164b48da9b268a02197f38caa69b118 (patch) | |
tree | 3352f158c7173094f84deb1cbad25a9a40122d32 /tools/perf/util/scripting-engines/trace-event-perl.c | |
parent | ace3d8614ab0e6544f5f85921085b55b915fe9aa (diff) |
HID: uhid: allow poll()'ing on uhid devices
As long as the internal buffer is not empty, we return POLLIN to
user-space.
uhid->head and uhid->tail are no atomics so the comparison may return
inexact results. However, this doesn't matter here as user-space would
need to poll() in two threads simultaneously to trigger this. And in this
case it doesn't matter if a cached result is returned or the exact new
result as user-space does not know which thread returns first from poll()
and the following read(). So it is safe to compare the values without
locking.
Signed-off-by: David Herrmann <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-perl.c')
0 files changed, 0 insertions, 0 deletions