mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-12-25 22:57:46 +00:00
Fixed threadpool bug when running on single core systems.
*Thanks to freshman for reporting bug.
This commit is contained in:
parent
464dbe7379
commit
70ae2ee711
1 changed files with 8 additions and 5 deletions
|
@ -2009,10 +2009,13 @@ bool Blockchain::check_tx_inputs(const transaction& tx, uint64_t* pmax_used_bloc
|
|||
boost::thread_group threadpool;
|
||||
|
||||
std::auto_ptr < boost::asio::io_service::work > work(new boost::asio::io_service::work(ioservice));
|
||||
for (int i = 0; i < threads; i++)
|
||||
{
|
||||
threadpool.create_thread(boost::bind(&boost::asio::io_service::run, &ioservice));
|
||||
}
|
||||
if(threads > 1)
|
||||
{
|
||||
for (int i = 0; i < threads; i++)
|
||||
{
|
||||
threadpool.create_thread(boost::bind(&boost::asio::io_service::run, &ioservice));
|
||||
}
|
||||
}
|
||||
|
||||
#define KILL_IOSERVICE() \
|
||||
if(threads > 1) \
|
||||
|
|
Loading…
Reference in a new issue