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

Fix threadpool reference unsafety #45

Open
UkoeHB opened this issue Apr 25, 2024 · 0 comments
Open

Fix threadpool reference unsafety #45

UkoeHB opened this issue Apr 25, 2024 · 0 comments

Comments

@UkoeHB
Copy link
Owner

UkoeHB commented Apr 25, 2024

It is unsafe to use raw threadpool references everywhere. Instead, use std::shared_ptr.

The actual threadpool constructor can be hidden and only usable by a wrapper class that stores a shared_ptr of the threadpool. Then overload operator*/operator-> to dereference to the inner threadpool.

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

No branches or pull requests

1 participant