mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-31 18:24:25 +03:00
Made gcc 4.4 work.
This commit is contained in:
@ -19,8 +19,8 @@
|
||||
|
||||
/** @file chrono.hpp
|
||||
*
|
||||
* Type definitions to work around differences in <chrono> 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 <typename T>
|
||||
using time_point = std::chrono::time_point<T>;
|
||||
using steady_clock = std::chrono::monotonic_clock;
|
||||
typedef std::chrono::monotonic_clock clock;
|
||||
#else
|
||||
template <typename T>
|
||||
using time_point = std::chrono::time_point<T>;
|
||||
using steady_clock = std::chrono::steady_clock;
|
||||
}
|
||||
using clock = std::chrono::steady_clock;
|
||||
#endif // defined(__GNUG__) && (__GNUC__ == 4 && __GNUC_MINOR__ == 4)
|
||||
|
||||
}
|
||||
|
@ -587,9 +587,9 @@ namespace wsrep
|
||||
int enter_toi_local(
|
||||
const wsrep::key_array& key_array,
|
||||
const wsrep::const_buffer& buffer,
|
||||
wsrep::chrono::time_point<wsrep::chrono::steady_clock>
|
||||
std::chrono::time_point<wsrep::clock>
|
||||
wait_until =
|
||||
wsrep::chrono::time_point<wsrep::chrono::steady_clock>());
|
||||
std::chrono::time_point<wsrep::clock>());
|
||||
/**
|
||||
* Enter applier TOI mode
|
||||
*
|
||||
@ -663,9 +663,9 @@ namespace wsrep
|
||||
int begin_nbo_phase_one(
|
||||
const wsrep::key_array& keys,
|
||||
const wsrep::const_buffer& buffer,
|
||||
wsrep::chrono::time_point<wsrep::chrono::steady_clock>
|
||||
std::chrono::time_point<wsrep::clock>
|
||||
wait_until =
|
||||
wsrep::chrono::time_point<wsrep::chrono::steady_clock>());
|
||||
std::chrono::time_point<wsrep::clock>());
|
||||
|
||||
/**
|
||||
* End non-blocking operation phase after aquiring required
|
||||
|
@ -339,7 +339,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<wsrep::chrono::steady_clock> wait_until)
|
||||
std::chrono::time_point<wsrep::clock> wait_until)
|
||||
{
|
||||
debug_log_state("enter_toi_local: enter");
|
||||
assert(state_ == s_exec);
|
||||
@ -359,7 +359,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)
|
||||
@ -476,7 +476,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<wsrep::chrono::steady_clock> wait_until)
|
||||
std::chrono::time_point<wsrep::clock> wait_until)
|
||||
{
|
||||
debug_log_state("begin_nbo_phase_one: enter");
|
||||
wsrep::unique_lock<wsrep::mutex> lock(mutex_);
|
||||
@ -495,7 +495,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)
|
||||
|
Reference in New Issue
Block a user