cut down the number of readable_.Broadcast()s
It's not hard to keep track of whether there are waiters, and there
usually aren't for most queues, so it helps performance a lot to not
make all those unnecessary syscalls.
diff --git a/aos/linux_code/ipc_lib/queue.h b/aos/linux_code/ipc_lib/queue.h
index d4d2609..5edce62 100644
--- a/aos/linux_code/ipc_lib/queue.h
+++ b/aos/linux_code/ipc_lib/queue.h
@@ -160,6 +160,11 @@
// reader if we transition it.
bool writable_start_;
+ // True iff somebody is currently Wait()ing on readable_.
+ // Set to true by each reader before calling Wait() and set back to false
+ // before the Broadcast().
+ bool readable_waiting_;
+
// Actually frees the given message.
void DoFreeMessage(const void *msg);
// Calls DoFreeMessage if appropriate.