Fixed some new code smells

This commit is contained in:
Peter Conrad 2018-10-09 23:42:03 +02:00
parent d0b280aca7
commit 018642659d
5 changed files with 8 additions and 6 deletions

View file

@ -49,7 +49,7 @@ namespace fc {
private:
class ticket_guard {
public:
ticket_guard( boost::atomic<future<void>*>& latch );
explicit ticket_guard( boost::atomic<future<void>*>& latch );
~ticket_guard();
void wait_for_my_turn();
private:

View file

@ -25,6 +25,8 @@ namespace fc {
*/
class thread_idle_notifier {
public:
virtual ~thread_idle_notifier() {}
/** This method is called when the thread is idle. If it returns a
* task_base it will be queued and executed immediately.
* @return a task to execute, or nullptr

View file

@ -119,7 +119,7 @@ namespace fc {
{
// the default was not set by the configuration. Determine a good
// number of threads. Minimum of 8, maximum of hardware_concurrency
num_io_threads = std::max( boost::thread::hardware_concurrency(), 8u );
num_io_threads = std::max( boost::thread::hardware_concurrency(), 8U );
}
for( uint16_t i = 0; i < num_io_threads; ++i )

View file

@ -32,8 +32,6 @@
namespace fc {
namespace detail {
class pool_impl;
class idle_notifier_impl : public thread_idle_notifier
{
public:
@ -49,6 +47,8 @@ namespace fc {
is_idle.store( copy.is_idle.load() );
}
virtual ~idle_notifier_impl() {}
virtual task_base* idle();
virtual void busy()
{
@ -63,7 +63,7 @@ namespace fc {
class pool_impl
{
public:
pool_impl( const uint16_t num_threads )
explicit pool_impl( const uint16_t num_threads )
: idle_threads( 2 * num_threads ), waiting_tasks( 200 )
{
notifiers.resize( num_threads );

View file

@ -19,7 +19,7 @@ namespace fc {
namespace detail {
class idle_guard {
public:
idle_guard( thread_d* t );
explicit idle_guard( thread_d* t );
~idle_guard();
private:
thread_idle_notifier* notifier;