mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Redesign stoppable object pattern
This commit is contained in:
committed by
manojsdoshi
parent
c10c0be11b
commit
a2a37a928a
@@ -324,8 +324,7 @@ Pg::clear()
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
PgPool::PgPool(Section const& pgConfig, Stoppable& parent, beast::Journal j)
|
||||
: Stoppable("PgPool", parent), j_(j)
|
||||
PgPool::PgPool(Section const& pgConfig, beast::Journal j) : j_(j)
|
||||
{
|
||||
// Make sure that boost::asio initializes the SSL library.
|
||||
{
|
||||
@@ -501,13 +500,12 @@ PgPool::setup()
|
||||
}
|
||||
|
||||
void
|
||||
PgPool::onStop()
|
||||
PgPool::stop()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
stop_ = true;
|
||||
cond_.notify_all();
|
||||
idle_.clear();
|
||||
stopped();
|
||||
JLOG(j_.info()) << "stopped";
|
||||
}
|
||||
|
||||
@@ -595,9 +593,9 @@ PgPool::checkin(std::unique_ptr<Pg>& pg)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
std::shared_ptr<PgPool>
|
||||
make_PgPool(Section const& pgConfig, Stoppable& parent, beast::Journal j)
|
||||
make_PgPool(Section const& pgConfig, beast::Journal j)
|
||||
{
|
||||
auto ret = std::make_shared<PgPool>(pgConfig, parent, j);
|
||||
auto ret = std::make_shared<PgPool>(pgConfig, j);
|
||||
ret->setup();
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user