Tests SensorEventQueue I/O when the queue is full.
Reduced debug logging in multihal.
Change-Id: I30e80630ce5d97776c53f26d6096ef59b9b2f35a
diff --git a/modules/sensors/SensorEventQueue.cpp b/modules/sensors/SensorEventQueue.cpp
index 00013de..6928034 100644
--- a/modules/sensors/SensorEventQueue.cpp
+++ b/modules/sensors/SensorEventQueue.cpp
@@ -81,8 +81,12 @@
mStart = (mStart + 1) % mCapacity;
}
-void SensorEventQueue::waitForSpace(pthread_mutex_t* mutex) {
+// returns true if it waited, or false if it was a no-op.
+bool SensorEventQueue::waitForSpace(pthread_mutex_t* mutex) {
+ bool waited = false;
while (mSize == mCapacity) {
+ waited = true;
pthread_cond_wait(&mSpaceAvailableCondition, mutex);
}
+ return waited;
}