diff --git a/include/wsrep/chrono.hpp b/include/wsrep/chrono.hpp index d41a28b..e657616 100644 --- a/include/wsrep/chrono.hpp +++ b/include/wsrep/chrono.hpp @@ -19,8 +19,8 @@ /** @file chrono.hpp * - * Type definitions to work around differences in implementation - * differences between C++11 compatible and ancient compilers. + * Type definitions to work around GCC 4.4 incompatibilities with + * C++11 chrono. */ #ifndef WSREP_CHRONO_HPP @@ -30,17 +30,11 @@ namespace wsrep { - namespace chrono - { + /* wsrep::clock - clock type compatible with std::chrono::steady_clock. */ #if defined(__GNUG__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 4) - template - using time_point = std::chrono::time_point; - using steady_clock = std::chrono::monotonic_clock; + typedef std::chrono::monotonic_clock clock; #else - template - using time_point = std::chrono::time_point; - using steady_clock = std::chrono::steady_clock; - } + using clock = std::chrono::steady_clock; #endif // defined(__GNUG__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 4) } diff --git a/include/wsrep/client_state.hpp b/include/wsrep/client_state.hpp index 06c8816..4c2f4a8 100644 --- a/include/wsrep/client_state.hpp +++ b/include/wsrep/client_state.hpp @@ -683,9 +683,9 @@ namespace wsrep int enter_toi_local( const wsrep::key_array& key_array, const wsrep::const_buffer& buffer, - wsrep::chrono::time_point + std::chrono::time_point wait_until = - wsrep::chrono::time_point()); + std::chrono::time_point()); /** * Enter applier TOI mode * @@ -759,9 +759,9 @@ namespace wsrep int begin_nbo_phase_one( const wsrep::key_array& keys, const wsrep::const_buffer& buffer, - wsrep::chrono::time_point + std::chrono::time_point wait_until = - wsrep::chrono::time_point()); + std::chrono::time_point()); /** * End non-blocking operation phase after aquiring required diff --git a/src/client_state.cpp b/src/client_state.cpp index 632c58c..0b63bae 100644 --- a/src/client_state.cpp +++ b/src/client_state.cpp @@ -340,7 +340,7 @@ void wsrep::client_state::enter_toi_common( int wsrep::client_state::enter_toi_local(const wsrep::key_array& keys, const wsrep::const_buffer& buffer, - wsrep::chrono::time_point wait_until) + std::chrono::time_point wait_until) { debug_log_state("enter_toi_local: enter"); assert(state_ == s_exec); @@ -360,7 +360,7 @@ int wsrep::client_state::enter_toi_local(const wsrep::key_array& keys, } while (status == wsrep::provider::error_certification_failed && wait_until.time_since_epoch().count() && - wait_until < wsrep::chrono::steady_clock::now() && + wait_until < wsrep::clock::now() && not client_service_.interrupted(lock)); switch (status) @@ -477,7 +477,7 @@ int wsrep::client_state::end_rsu() int wsrep::client_state::begin_nbo_phase_one( const wsrep::key_array& keys, const wsrep::const_buffer& buffer, - wsrep::chrono::time_point wait_until) + std::chrono::time_point wait_until) { debug_log_state("begin_nbo_phase_one: enter"); wsrep::unique_lock lock(mutex_); @@ -496,7 +496,7 @@ int wsrep::client_state::begin_nbo_phase_one( } while (status == wsrep::provider::error_certification_failed && wait_until.time_since_epoch().count() && - wait_until < wsrep::chrono::steady_clock::now() && + wait_until < wsrep::clock::now() && not client_service_.interrupted(lock)); int ret; switch (status)