Skip to content

Commit 1363e98

Browse files
authored
Merge pull request #2330 from jamescowens/update_scheduler
util: Update scheduler and remove Boost chrono
2 parents 63a6393 + 9fa6a14 commit 1363e98

36 files changed

+760
-454
lines changed

build-aux/m4/ax_boost_chrono.m4

Lines changed: 0 additions & 118 deletions
This file was deleted.

ci/test/00_setup_env_native.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8
88

99
export CONTAINER_NAME=ci_native
1010
export DOCKER_NAME_TAG=ubuntu:20.04
11-
export PACKAGES="libqt5gui5 libqt5core5a qtbase5-dev libqt5dbus5 qttools5-dev qttools5-dev-tools libssl-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-iostreams-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libqrencode-dev libzip-dev zlib1g zlib1g-dev libcurl4 libcurl4-openssl-dev"
11+
export PACKAGES="libqt5gui5 libqt5core5a qtbase5-dev libqt5dbus5 qttools5-dev qttools5-dev-tools libssl-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-iostreams-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libqrencode-dev libzip-dev zlib1g zlib1g-dev libcurl4 libcurl4-openssl-dev"
1212
export RUN_UNIT_TESTS=true
1313
# export RUN_FUNCTIONAL_TESTS=false
1414
# export RUN_SECURITY_TESTS="true"

ci/test/00_setup_env_native_old.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8
88

99
export CONTAINER_NAME=ci_native_old
1010
export DOCKER_NAME_TAG=ubuntu:18.04
11-
export PACKAGES="libqt5gui5 libqt5core5a qtbase5-dev libqt5dbus5 qttools5-dev qttools5-dev-tools libssl-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-iostreams-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libqrencode-dev libzip-dev zlib1g zlib1g-dev libcurl4-openssl-dev"
11+
export PACKAGES="libqt5gui5 libqt5core5a qtbase5-dev libqt5dbus5 qttools5-dev qttools5-dev-tools libssl-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-iostreams-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libqrencode-dev libzip-dev zlib1g zlib1g-dev libcurl4-openssl-dev"
1212
export RUN_UNIT_TESTS=true
1313
# export RUN_FUNCTIONAL_TESTS=false
1414
# export RUN_SECURITY_TESTS="true"

configure.ac

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,6 @@ AX_BOOST_BASE([MINIMUM_REQUIRED_BOOST])
940940
AX_BOOST_SYSTEM
941941
AX_BOOST_FILESYSTEM
942942
AX_BOOST_THREAD
943-
AX_BOOST_CHRONO
944943
AX_BOOST_ZLIB
945944
AX_BOOST_IOSTREAMS
946945

@@ -949,7 +948,7 @@ dnl counter implementations. In 1.63 and later the std::atomic approach is defau
949948
m4_pattern_allow(DBOOST_AC_USE_STD_ATOMIC) dnl otherwise it's treated like a macro
950949
BOOST_CPPFLAGS="-DBOOST_SP_USE_STD_ATOMIC -DBOOST_AC_USE_STD_ATOMIC $BOOST_CPPFLAGS"
951950

952-
BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_THREAD_LIB"
951+
BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_IOSTREAMS_LIB $BOOST_THREAD_LIB $BOOST_ZLIB_LIB"
953952
fi
954953

955954
if test x$use_reduce_exports = xyes; then
@@ -989,34 +988,6 @@ if test x$use_tests = xyes; then
989988
fi
990989
fi
991990

992-
if test x$use_boost = xyes; then
993-
994-
BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_ZLIB_LIB $BOOST_IOSTREAMS_LIB $BOOST_THREAD_LIB $BOOST_CHRONO_LIB $BOOST_ZLIB_LIB"
995-
996-
dnl Boost >= 1.50 uses sleep_for rather than the now-deprecated sleep.
997-
dnl Use sleep_for if a working version is available. If not, abort.
998-
TEMP_LIBS="$LIBS"
999-
LIBS="$BOOST_LIBS $LIBS"
1000-
TEMP_CPPFLAGS="$CPPFLAGS"
1001-
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
1002-
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1003-
#include <boost/thread/thread.hpp>
1004-
#include <boost/version.hpp>
1005-
]],[[
1006-
boost::this_thread::sleep_for(boost::chrono::milliseconds(0));
1007-
]])],
1008-
[boost_sleep=yes;
1009-
AC_DEFINE(HAVE_WORKING_BOOST_SLEEP_FOR, 1, [Define this symbol if boost sleep_for works])],
1010-
[boost_sleep=no])
1011-
LIBS="$TEMP_LIBS"
1012-
CPPFLAGS="$TEMP_CPPFLAGS"
1013-
1014-
if test x$boost_sleep != xyes; then
1015-
AC_MSG_ERROR(No working boost sleep implementation found.)
1016-
fi
1017-
1018-
fi
1019-
1020991
PKG_CHECK_MODULES([SSL], [libssl],, [AC_MSG_ERROR(openssl not found.)])
1021992
PKG_CHECK_MODULES([CRYPTO], [libcrypto],,[AC_MSG_ERROR(libcrypto not found.)])
1022993
PKG_CHECK_MODULES([LIBZIP], [libzip],,[AC_MSG_ERROR(libzip not found.)])

depends/packages/boost.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ ifneq (,$(findstring clang,$($(package)_cxx)))
2727
$(package)_toolset_$(host_os)=clang
2828
endif
2929
$(package)_archiver_$(host_os)=$($(package)_ar)
30-
$(package)_config_libraries=chrono,filesystem,system,thread,test,iostreams
30+
$(package)_config_libraries=filesystem,system,thread,test,iostreams
3131
$(package)_cxxflags=-std=c++17 -fvisibility=hidden
3232
$(package)_cxxflags_linux=-fPIC
3333
$(package)_cxxflags_android=-fPIC

doc/build-openbsd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ patch -p0 < /usr/ports/devel/boost/patches/patch-boost_test_impl_execution_monit
6161
# Build w/ minimum configuration necessary for bitcoin
6262
echo 'using gcc : : eg++ : <cxxflags>"-fvisibility=hidden -fPIC" <linkflags>"" <archiver>"ar" <striper>"strip" <ranlib>"ranlib" <rc>"" : ;' > user-config.jam
6363
config_opts="runtime-link=shared threadapi=pthread threading=multi link=static variant=release --layout=tagged --build-type=complete --user-config=user-config.jam -sNO_BZIP2=1"
64-
./bootstrap.sh --without-icu --with-libraries=chrono,filesystem,system,thread,test
64+
./bootstrap.sh --without-icu --with-libraries=filesystem,system,thread,test
6565
./b2 -d2 -j2 -d1 ${config_opts} --prefix=${BOOST_PREFIX} stage
6666
./b2 -d0 -j4 ${config_opts} --prefix=${BOOST_PREFIX} install
6767
```

doc/build-unix.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Options when installing required Boost library files:
9090
individual boost development packages, so the following can be used to only
9191
install necessary parts of boost:
9292

93-
sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libboost-iostreams-dev libcurl4-gnutls-dev
93+
sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-test-dev libboost-thread-dev libboost-iostreams-dev libcurl4-gnutls-dev
9494

9595
2. If that doesn't work, you can install all boost development packages with:
9696

@@ -164,11 +164,11 @@ install necessary parts of boost:
164164

165165
Tumbleweed:
166166

167-
sudo zypper install libboost_system1_*_0-devel libboost_filesystem1_*_0-devel libboost_chrono1_*_0-devel libboost_test1_*_0-devel libboost_thread1_*_0-devel
167+
sudo zypper install libboost_system1_*_0-devel libboost_filesystem1_*_0-devel libboost_test1_*_0-devel libboost_thread1_*_0-devel
168168

169169
Leap:
170170

171-
sudo zypper install libboost_system1_61_0-devel libboost_filesystem1_61_0-devel libboost_chrono1_61_0-devel libboost_test1_61_0-devel libboost_thread1_61_0-devel
171+
sudo zypper install libboost_system1_61_0-devel libboost_filesystem1_61_0-devel libboost_test1_61_0-devel libboost_thread1_61_0-devel
172172

173173
2. If that doesn't work, you can install all boost development packages with:
174174

gridcoinresearch.pro

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,8 +553,6 @@ LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX -lcurl -lzip
553553
windows:LIBS += -lws2_32 -lshlwapi -lmswsock -lole32 -loleaut32 -luuid -lgdi32
554554
LIBS += -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -lboost_thread$$BOOST_THREAD_LIB_SUFFIX -lcurl -lzip
555555

556-
windows:LIBS += -lboost_chrono$$BOOST_LIB_SUFFIX
557-
558556
contains(RELEASE, 1) {
559557
!windows:!macx {
560558
# Linux: turn dynamic linking back on for c/c++ runtime libraries

src/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ GRIDCOIN_CORE_H = \
169169
support/cleanse.h \
170170
support/lockedpool.h \
171171
sync.h \
172+
threadinterrupt.h \
172173
threadsafety.h \
173174
tinyformat.h \
174175
txdb.h \
@@ -268,6 +269,7 @@ GRIDCOIN_CORE_CPP = addrdb.cpp \
268269
support/cleanse.cpp \
269270
support/lockedpool.cpp \
270271
sync.cpp \
272+
threadinterrupt.cpp \
271273
txdb-leveldb.cpp \
272274
uint256.cpp \
273275
util/settings.cpp \

src/Makefile.test.include

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ GRIDCOIN_TESTS =\
5757
test/multisig_tests.cpp \
5858
test/netbase_tests.cpp \
5959
test/rpc_tests.cpp \
60+
test/scheduler_tests.cpp \
6061
test/script_p2sh_tests.cpp \
6162
test/script_tests.cpp \
6263
test/serialize_tests.cpp \

0 commit comments

Comments
 (0)