Fix a shutdown problem in block_processor (#3646)

* Fix a shutdown problem in block_processor

* Use join_or_pass

Co-authored-by: Dimitrios Siganos <dimitris@siganos.org>
This commit is contained in:
cryptocode 2023-01-19 16:37:23 +01:00 committed by GitHub
commit 154b7fd9a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 10 deletions

View file

@ -50,15 +50,6 @@ nano::block_processor::block_processor (nano::node & node_a, nano::write_databas
});
}
nano::block_processor::~block_processor ()
{
stop ();
if (processing_thread.joinable ())
{
processing_thread.join ();
}
}
void nano::block_processor::stop ()
{
{
@ -67,6 +58,7 @@ void nano::block_processor::stop ()
}
condition.notify_all ();
state_block_signature_verification.stop ();
nano::join_or_pass (processing_thread);
}
void nano::block_processor::flush ()

View file

@ -41,7 +41,6 @@ class block_processor final
{
public:
explicit block_processor (nano::node &, nano::write_database_queue &);
~block_processor ();
void stop ();
void flush ();
std::size_t size ();