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

Implemented thread service support.

Added a wsrep::thread_service interface to allow application to
inject instrumented thread, mutex and condition variable implementation
for provider.

The interface is defined in include/wsrep/thread_service.hpp.
Sample implementation is provided in dbsim/db_threads.[h|c]pp.

This patch will also clean up some remaining dependencies to
wsrep-API compilation units so that the dependency to wsrep-API
is header only. This will extending the provider support to
later wsrep-API versions.
This commit is contained in:
Teemu Ollakka
2019-02-16 17:09:18 +02:00
parent 477a71dd46
commit eb4cf86c1e
33 changed files with 1821 additions and 58 deletions

View File

@ -307,6 +307,10 @@ namespace wsrep
/**
* Append a key into transaction write set.
*
* @param key Key to be appended
*
* @return Zero on success, non-zero on failure.
*/
int append_key(const wsrep::key& key)
{
@ -315,6 +319,27 @@ namespace wsrep
return transaction_.append_key(key);
}
/**
* Append keys in key_array into transaction write set.
*
* @param keys Array of keys to be appended
*
* @return Zero in case of success, non-zero on failure.
*/
int append_keys(const wsrep::key_array& keys)
{
assert(mode_ == m_local || mode_ == m_toi);
assert(state_ == s_exec);
for (auto i(keys.begin()); i != keys.end(); ++i)
{
if (transaction_.append_key(*i))
{
return 1;
}
}
return 0;
}
/**
* Append data into transaction write set.
*/