Add utility for thread queue pusher in AOS

This adds a class that provides a queue where one thread (that does the
heavy lifting) will fill in a queue, and another, more
timing-critical, thread has to pop messages from the queue.

Change-Id: I51586528adc34dceddbd94549285900dc16d5bf4
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/util/BUILD b/aos/util/BUILD
index 12e5ab7..40293c0 100644
--- a/aos/util/BUILD
+++ b/aos/util/BUILD
@@ -384,3 +384,24 @@
     visibility = ["//visibility:public"],
     deps = ["//aos:python_init"],
 )
+
+cc_library(
+    name = "threaded_queue",
+    hdrs = [
+        "threaded_queue.h",
+        "threaded_queue_tmpl.h",
+    ],
+    deps = [
+        "//aos:condition",
+        "//aos/mutex",
+    ],
+)
+
+cc_test(
+    name = "threaded_queue_test",
+    srcs = ["threaded_queue_test.cc"],
+    deps = [
+        ":threaded_queue",
+        "//aos/testing:googletest",
+    ],
+)