Skip to content

Commit

Permalink
fix: Use std::chrono consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisklein committed Mar 6, 2023
1 parent 05b734e commit 8960ce9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 4 additions & 1 deletion fairmq/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ if(BUILD_FAIRMQ)
############################
# preprocessor definitions #
############################
target_compile_definitions(${target} PUBLIC BOOST_ERROR_CODE_HEADER_ONLY)
target_compile_definitions(${target} PUBLIC
BOOST_ERROR_CODE_HEADER_ONLY
BOOST_ASIO_HAS_HAS_STD_CHRONO
)
if(FAIRMQ_DEBUG_MODE)
target_compile_definitions(${target} PUBLIC FAIRMQ_DEBUG_MODE)
endif()
Expand Down
2 changes: 1 addition & 1 deletion fairmq/shmem/Manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

#include <fairlogger/Logger.h>

#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/interprocess/ipc/message_queue.hpp>
#include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/interprocess/sync/interprocess_condition.hpp>
Expand All @@ -28,6 +27,7 @@
#include <boost/variant.hpp>

#include <algorithm> // max
#include <chrono>
#include <condition_variable>
#include <cstddef> // max_align_t
#include <cstdlib> // getenv
Expand Down
10 changes: 6 additions & 4 deletions fairmq/tools/Process.cxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* Copyright (C) 2017-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
* *
* This software is distributed under the terms of the *
* GNU Lesser General Public Licence (LGPL) version 3, *
Expand All @@ -10,8 +10,8 @@
#include <fairmq/tools/Strings.h>

#include <boost/asio.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/process.hpp>
#include <chrono>
#include <csignal> // kill, signals
#include <iostream>
#include <sstream>
Expand Down Expand Up @@ -77,8 +77,10 @@ execute_result execute(const string& cmd, const string& prefix, const string& in
bp::async_pipe errorPipe(ios);

const string delimiter = "\n";
ba::deadline_timer inputTimer(ios, boost::posix_time::milliseconds(1000)); // NOLINT
ba::deadline_timer signalTimer(ios, boost::posix_time::milliseconds(2000)); // NOLINT
ba::steady_timer inputTimer(ios);
inputTimer.expires_after(std::chrono::milliseconds(1000)); // NOLINT
ba::steady_timer signalTimer(ios);
signalTimer.expires_after(std::chrono::milliseconds(2000)); // NOLINT

// child process
bp::child c(cmd, bp::std_out > outputPipe, bp::std_err > errorPipe, bp::std_in < inputPipe);
Expand Down

0 comments on commit 8960ce9

Please sign in to comment.