1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-28 20:02:00 +03:00

Made gcc 4.4 work.

This commit is contained in:
Teemu Ollakka
2019-09-04 16:25:57 +03:00
parent b05abb005f
commit aaa92e130b
3 changed files with 13 additions and 19 deletions

View File

@ -19,8 +19,8 @@
/** @file chrono.hpp /** @file chrono.hpp
* *
* Type definitions to work around differences in <chrono> implementation * Type definitions to work around GCC 4.4 incompatibilities with
* differences between C++11 compatible and ancient compilers. * C++11 chrono.
*/ */
#ifndef WSREP_CHRONO_HPP #ifndef WSREP_CHRONO_HPP
@ -30,17 +30,11 @@
namespace wsrep namespace wsrep
{ {
namespace chrono /* wsrep::clock - clock type compatible with std::chrono::steady_clock. */
{
#if defined(__GNUG__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 4) #if defined(__GNUG__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 4)
template <typename T> typedef std::chrono::monotonic_clock clock;
using time_point = std::chrono::time_point<T>;
using steady_clock = std::chrono::monotonic_clock;
#else #else
template <typename T> using clock = std::chrono::steady_clock;
using time_point = std::chrono::time_point<T>;
using steady_clock = std::chrono::steady_clock;
}
#endif // defined(__GNUG__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 4) #endif // defined(__GNUG__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 4)
} }

View File

@ -683,9 +683,9 @@ namespace wsrep
int enter_toi_local( int enter_toi_local(
const wsrep::key_array& key_array, const wsrep::key_array& key_array,
const wsrep::const_buffer& buffer, const wsrep::const_buffer& buffer,
wsrep::chrono::time_point<wsrep::chrono::steady_clock> std::chrono::time_point<wsrep::clock>
wait_until = wait_until =
wsrep::chrono::time_point<wsrep::chrono::steady_clock>()); std::chrono::time_point<wsrep::clock>());
/** /**
* Enter applier TOI mode * Enter applier TOI mode
* *
@ -759,9 +759,9 @@ namespace wsrep
int begin_nbo_phase_one( int begin_nbo_phase_one(
const wsrep::key_array& keys, const wsrep::key_array& keys,
const wsrep::const_buffer& buffer, const wsrep::const_buffer& buffer,
wsrep::chrono::time_point<wsrep::chrono::steady_clock> std::chrono::time_point<wsrep::clock>
wait_until = wait_until =
wsrep::chrono::time_point<wsrep::chrono::steady_clock>()); std::chrono::time_point<wsrep::clock>());
/** /**
* End non-blocking operation phase after aquiring required * End non-blocking operation phase after aquiring required

View File

@ -340,7 +340,7 @@ void wsrep::client_state::enter_toi_common(
int wsrep::client_state::enter_toi_local(const wsrep::key_array& keys, int wsrep::client_state::enter_toi_local(const wsrep::key_array& keys,
const wsrep::const_buffer& buffer, const wsrep::const_buffer& buffer,
wsrep::chrono::time_point<wsrep::chrono::steady_clock> wait_until) std::chrono::time_point<wsrep::clock> wait_until)
{ {
debug_log_state("enter_toi_local: enter"); debug_log_state("enter_toi_local: enter");
assert(state_ == s_exec); 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 && while (status == wsrep::provider::error_certification_failed &&
wait_until.time_since_epoch().count() && wait_until.time_since_epoch().count() &&
wait_until < wsrep::chrono::steady_clock::now() && wait_until < wsrep::clock::now() &&
not client_service_.interrupted(lock)); not client_service_.interrupted(lock));
switch (status) switch (status)
@ -477,7 +477,7 @@ int wsrep::client_state::end_rsu()
int wsrep::client_state::begin_nbo_phase_one( int wsrep::client_state::begin_nbo_phase_one(
const wsrep::key_array& keys, const wsrep::key_array& keys,
const wsrep::const_buffer& buffer, const wsrep::const_buffer& buffer,
wsrep::chrono::time_point<wsrep::chrono::steady_clock> wait_until) std::chrono::time_point<wsrep::clock> wait_until)
{ {
debug_log_state("begin_nbo_phase_one: enter"); debug_log_state("begin_nbo_phase_one: enter");
wsrep::unique_lock<wsrep::mutex> lock(mutex_); wsrep::unique_lock<wsrep::mutex> lock(mutex_);
@ -496,7 +496,7 @@ int wsrep::client_state::begin_nbo_phase_one(
} }
while (status == wsrep::provider::error_certification_failed && while (status == wsrep::provider::error_certification_failed &&
wait_until.time_since_epoch().count() && wait_until.time_since_epoch().count() &&
wait_until < wsrep::chrono::steady_clock::now() && wait_until < wsrep::clock::now() &&
not client_service_.interrupted(lock)); not client_service_.interrupted(lock));
int ret; int ret;
switch (status) switch (status)