From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ v1 1/5] shared/mainloop: Free removed idles without waiting for events
Date: Tue, 3 Nov 2026 15:30:30 -0500 [thread overview]
Message-ID: <20261103203034.3904499-2-luiz.dentz@gmail.com> (raw)
In-Reply-To: <20261103203034.3904499-1-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Removing the last armed idle left it in the list without any idle
pending, so mainloop_run() would block in epoll_wait() and the idle and
its destroy callback would not be released until another event.
Fix this by considering removed idles as pending so they are freed on
the next iteration.
---
src/shared/mainloop.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/shared/mainloop.c b/src/shared/mainloop.c
index 653f22db70e6..27de2b02ae09 100644
--- a/src/shared/mainloop.c
+++ b/src/shared/mainloop.c
@@ -361,8 +361,11 @@ static bool idle_pending(void)
{
struct idle_data *idle;
+ /* Removed idles also count so they are freed without waiting for
+ * another event.
+ */
for (idle = idle_list; idle; idle = idle->next) {
- if (idle->armed && !idle->removed)
+ if (idle->armed || idle->removed)
return true;
}
--
2.56.0
next prev parent reply other threads:[~2026-11-03 20:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 20:30 [PATCH BlueZ v1 0/5] Make Notify Multiple timeout configurable Luiz Augusto von Dentz
2026-11-03 20:30 ` Luiz Augusto von Dentz [this message]
2026-11-03 22:42 ` bluez.test.bot
2026-11-03 20:30 ` [PATCH BlueZ v1 2/5] shared/mainloop: Fix idle ID overflow Luiz Augusto von Dentz
2026-11-03 20:30 ` [PATCH BlueZ v1 3/5] shared/gatt-server: Add bt_gatt_server_set_mnotify_timeout Luiz Augusto von Dentz
2026-11-03 20:30 ` [PATCH BlueZ v1 4/5] unit/test-gatt: Add Notify Multiple server tests Luiz Augusto von Dentz
2026-11-03 20:30 ` [PATCH BlueZ v1 5/5] main.conf: Add NotifyMultiple option to GATT section Luiz Augusto von Dentz
2026-11-04 19:10 ` [PATCH BlueZ v1 0/5] Make Notify Multiple timeout configurable patchwork-bot+bluetooth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261103203034.3904499-2-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox