Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable thread_pool_impl users to add workers to the thread pool #487

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

dsharlet
Copy link
Owner

@dsharlet dsharlet commented Nov 8, 2024

No description provided.

Copy link
Collaborator

@steven-johnson steven-johnson left a comment

Choose a reason for hiding this comment

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

LGTM but this could really use a test.

@@ -108,12 +109,17 @@ class thread_pool_impl : public thread_pool {
task_id dequeue(task& t);

public:
// Constructs a thread pool with no worker threads. Use `run_worker` to enter a thread into the thread pool.
thread_pool_impl();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not = default; ?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Don't want it to be inline, a few objects with non-trivial constructors in this class.

@dsharlet
Copy link
Owner Author

dsharlet commented Nov 8, 2024

LGTM but this could really use a test.

This doesn't actually introduce any new code paths. It's using the new functionality itself for the default behavior. So all the existing thread pool tests are testing this.

@dsharlet dsharlet merged commit ae452f6 into main Nov 8, 2024
1 check passed
@dsharlet dsharlet deleted the ds/thread-pool branch November 8, 2024 01:42
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.

2 participants