added connection pool and tests

This commit is contained in:
Sascha Kühl
2025-02-05 15:47:51 +01:00
parent 45a7199ccf
commit bc3ffbda10
20 changed files with 495 additions and 53 deletions
+27
View File
@@ -0,0 +1,27 @@
#include "auto_reset_event.hpp"
namespace matador::test::utils {
auto_reset_event::auto_reset_event() : state(false) {}
void auto_reset_event::wait_one()
{
std::unique_lock<std::mutex> lock(sync);
underlying.wait(lock, [this](){return state.load();});
state = false;
}
void auto_reset_event::set()
{
std::unique_lock<std::mutex> lock(sync);
state = true;
underlying.notify_one();
}
void auto_reset_event::reset()
{
std::unique_lock<std::mutex> lock(sync);
state = false;
}
}