commit | ab6ec384c456022f37a9c6183d3afbcefcb436a9 | [log] [tgz] |
---|---|---|
author | Aaron Whyte <awhyte@google.com> | Tue Oct 22 17:17:17 2013 -0700 |
committer | Mike Lockwood <lockwood@google.com> | Thu Nov 14 11:24:15 2013 -0800 |
tree | 2efe5a0ba86680b7a168e834cc05fa94d1f97d20 | |
parent | 079083281e2a9e479b09ae3fc4d2dc5c738e3d31 [diff] |
Added a SensorEventQueue, a circular buffer meant for reading with one thread and polling a subhal with another. The writing thread gets access to pointers in the internal buffer. This design avoids a memcpy on write when the multihal fetches subhal events using poll(). Unit-tests include multithreaded reading and writing lots of events, in random-sized chunks. This is not used by the multihal yet. That will be a different CL. Change-Id: I58418d69eebebeb96befb08ba3aed080f0f08551