Skip to content

refactor: rename EventLoop::m_num_clients to m_num_refs#302

Open
Sjors wants to merge 1 commit into
bitcoin-core:masterfrom
Sjors:2026/07/num-clients
Open

refactor: rename EventLoop::m_num_clients to m_num_refs#302
Sjors wants to merge 1 commit into
bitcoin-core:masterfrom
Sjors:2026/07/num-clients

Conversation

@Sjors

@Sjors Sjors commented Jul 2, 2026

Copy link
Copy Markdown
Member

Rename the variable and document what it counts, so the loop() exit condition in EventLoop::done() is not misread as "exit when no clients are connected".

I found myself confused by this while reviewing #269.

Rename the variable and document what it counts, so the loop() exit
condition in EventLoop::done() is not misread as "exit when no
clients are connected".
@DrahtBot

DrahtBot commented Jul 2, 2026

Copy link
Copy Markdown

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK ViniciusCestarii

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

@ViniciusCestarii ViniciusCestarii left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK d499830, I agree this name is clearer.

Comment thread include/mp/proxy-io.h
//! Run event loop. Does not return until shutdown. This should only be
//! called once from the m_thread_id thread. This will block until
//! the m_num_clients reference count is 0.
//! the m_num_refs reference count is 0.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In "refactor: rename EventLoop::m_num_clients to m_num_refs" d499830

nit: "the m_num_refs reference count" is a bit redundant now because "refs" already means references. Could be renamed to "the m_num_refs count is 0" (unrelated but this condition is also incomplete: loop() exits on done(), m_num_refs == 0 and m_async_fns is empty).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants