+240
−0
+153
−0
Loading
Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more
Refer to aosp/976133 for usages of this. That patch is big enough that I would like to get this reviewed separately, as it's a more generic utility that could in principle be used by other components. This structure is useful because no existing structure (that I know of) allow polling in a thread-safe, sleeping/waking way, while also keeping the history of everything that happened. Also the ReadHead structure has semantics that are useful for doing multithread tests but do not exist elsewhere as far as I'm aware. LinkedBlockingQueue for example has the right thread/sleep/wake semantics but it assumes there must be one consumer for each piece of data (while ReadHead lets all readers stream the same data), and it does not allow for searching past elements that have already been enqueued. Test: Some new unit tests, others coming up in a followup Change-Id: I8311a4c72abbbf25d21e5630db0c14a6d59bcc3d