Merge pull request #342

70ae2ee Fixed threadpool bug when running on single core systems. *Thanks to freshman for reporting bug. (NoodleDoodleNoodleDoodleNoodleDoodleNoo)
464dbe7 Fixed MINGW duplicate library errors when MSYS folder cannot be found. *Thanks to luigi1111 for reporting. (NoodleDoodleNoodleDoodleNoodleDoodleNoo)
This commit is contained in:
Riccardo Spagni 2015-07-18 22:58:08 +02:00
commit d386be640d
No known key found for this signature in database
GPG Key ID: 55432DF31CCD4FCD
2 changed files with 13 additions and 10 deletions

View File

@ -159,16 +159,16 @@ endif()
option(STATIC "Link libraries statically" ${DEFAULT_STATIC}) option(STATIC "Link libraries statically" ${DEFAULT_STATIC})
if(MINGW) if(MINGW)
get_filename_component(msys2_install_path "[HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MSYS2 ${ARCH_WIDTH}bit;InstallLocation]" ABSOLUTE) string(REGEX MATCH "^[^/]:/[^/]*" msys2_install_path "${CMAKE_C_COMPILER}")
message(STATUS "MSYS location: ${msys2_install_path}")
set(CMAKE_INCLUDE_PATH "${msys2_install_path}/mingw${ARCH_WIDTH}/include") set(CMAKE_INCLUDE_PATH "${msys2_install_path}/mingw${ARCH_WIDTH}/include")
# This is necessary because otherwise CMake will make Boost libraries -lfoo # This is necessary because otherwise CMake will make Boost libraries -lfoo
# rather than a full path. Unfortunately, this makes the shared libraries get # rather than a full path. Unfortunately, this makes the shared libraries get
# linked due to a bug in CMake which misses putting -static flags around the # linked due to a bug in CMake which misses putting -static flags around the
# -lfoo arguments. # -lfoo arguments.
list(REMOVE_ITEM CMAKE_C_IMPLICIT_LINK_DIRECTORIES set(DEFLIB ${msys2_install_path}/mingw${ARCH_WIDTH}/lib)
"${msys2_install_path}/mingw${ARCH_WIDTH}/lib") list(REMOVE_ITEM CMAKE_C_IMPLICIT_LINK_DIRECTORIES ${DEFLIB})
list(REMOVE_ITEM CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES list(REMOVE_ITEM CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES ${DEFLIB})
"${msys2_install_path}/mingw${ARCH_WIDTH}/lib")
endif() endif()
if(STATIC) if(STATIC)

View File

@ -2009,10 +2009,13 @@ bool Blockchain::check_tx_inputs(const transaction& tx, uint64_t* pmax_used_bloc
boost::thread_group threadpool; boost::thread_group threadpool;
std::auto_ptr < boost::asio::io_service::work > work(new boost::asio::io_service::work(ioservice)); std::auto_ptr < boost::asio::io_service::work > work(new boost::asio::io_service::work(ioservice));
for (int i = 0; i < threads; i++) if(threads > 1)
{ {
threadpool.create_thread(boost::bind(&boost::asio::io_service::run, &ioservice)); for (int i = 0; i < threads; i++)
} {
threadpool.create_thread(boost::bind(&boost::asio::io_service::run, &ioservice));
}
}
#define KILL_IOSERVICE() \ #define KILL_IOSERVICE() \
if(threads > 1) \ if(threads > 1) \