UkoeHB / monero

Monero: the secure, private, untraceable cryptocurrency
https://getmonero.org
Other
7 stars 4 forks source link

Fix threadpool reference unsafety #45

Open UkoeHB opened 6 months ago

UkoeHB commented 6 months ago

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.