diff options
author | Chalard Jean <jchalard@google.com> | 2019-06-04 23:41:18 +0900 |
---|---|---|
committer | Chalard Jean <jchalard@google.com> | 2019-06-25 20:45:36 +0900 |
commit | c7f247b8303acad3588aa73127e1ce31dddc05a6 (patch) | |
tree | 62a369c88c9f8a20ff19ae1f569b1c70099bb88d /src/android/net/apf/ApfGenerator.java | |
parent | 91ef22f9470c028c83a138a850712263b73c4cc2 (diff) |
Add the recording queue utility.
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
Diffstat (limited to 'src/android/net/apf/ApfGenerator.java')
0 files changed, 0 insertions, 0 deletions