Skip to content

Commit

Permalink
Merge pull request #57 from AntelopeIO/io_context
Browse files Browse the repository at this point in the history
use `io_context` instead of `io_service`; fixes build on latest boost
  • Loading branch information
spoonincode authored Jan 10, 2025
2 parents 75e4dab + 93093dc commit d7ba67b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/chainbase/pinnable_mapped_file.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <system_error>
#include <boost/interprocess/managed_mapped_file.hpp>
#include <boost/interprocess/sync/file_lock.hpp>
#include <boost/asio/io_service.hpp>
#include <boost/asio/io_context.hpp>
#include <boost/container/flat_map.hpp>
#include <filesystem>
#include <vector>
Expand Down Expand Up @@ -85,7 +85,7 @@ class pinnable_mapped_file {

private:
void set_mapped_file_db_dirty(bool);
void load_database_file(boost::asio::io_service& sig_ios);
void load_database_file(boost::asio::io_context& sig_ios);
void save_database_file(bool flush = true);
static bool all_zeros(const std::byte* data, size_t sz);
void setup_non_file_mapping();
Expand Down
4 changes: 2 additions & 2 deletions src/pinnable_mapped_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ pinnable_mapped_file::pinnable_mapped_file(const std::filesystem::path& dir, boo
if (on_tempfs_filesystem(_data_file_path))
BOOST_THROW_EXCEPTION(std::system_error(make_error_code(db_error_code::tempfs_incompatible_mode)));

boost::asio::io_service sig_ios;
boost::asio::io_context sig_ios;
boost::asio::signal_set sig_set(sig_ios, SIGINT, SIGTERM);
#ifdef SIGPIPE
sig_set.add(SIGPIPE);
Expand Down Expand Up @@ -358,7 +358,7 @@ void pinnable_mapped_file::setup_non_file_mapping() {
#endif
}

void pinnable_mapped_file::load_database_file(boost::asio::io_service& sig_ios) {
void pinnable_mapped_file::load_database_file(boost::asio::io_context& sig_ios) {
std::cerr << "CHAINBASE: Preloading \"" << _database_name << "\" database file, this could take a moment..." << '\n';
char* const dst = (char*)_non_file_mapped_mapping;
size_t offset = 0;
Expand Down

0 comments on commit d7ba67b

Please sign in to comment.