[PATCH 2/4] android/audio: Change mainloop handle in ipc_handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make sure we wait 1 sec  after each loop iteration.
It is important in case of failure that we do not overload cpu.

---
 android/hal-audio.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/android/hal-audio.c b/android/hal-audio.c
index 7a7c111..4a12bcb 100644
--- a/android/hal-audio.c
+++ b/android/hal-audio.c
@@ -465,15 +465,14 @@ failed:
 
 static void *ipc_handler(void *data)
 {
-	bool done = false;
 	struct pollfd pfd;
+	bool done;
 
 	DBG("");
 
-	while (!done) {
+	for (done = false; !done; sleep(1)) {
 		if(!create_audio_ipc()) {
 			error("a2dp: Failed to create listening socket");
-			sleep(1);
 			continue;
 		}
 
-- 
1.8.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux