mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-18 16:42:54 +01:00
scheduler: Capture ‘this’ explicitly in lambda
Without the changes, g++ will warn to compile under C++20:
scheduler.cpp:114:21: warning: implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20 [-Wdeprecated]
114 | scheduleFromNow([=] { Repeat(*this, f, delta); }, delta);
| ^
scheduler.cpp:114:21: note: add explicit ‘this’ or ‘*this’ capture
This commit is contained in:
@@ -111,7 +111,7 @@ static void Repeat(CScheduler& s, CScheduler::Function f, std::chrono::milliseco
|
|||||||
|
|
||||||
void CScheduler::scheduleEvery(CScheduler::Function f, std::chrono::milliseconds delta)
|
void CScheduler::scheduleEvery(CScheduler::Function f, std::chrono::milliseconds delta)
|
||||||
{
|
{
|
||||||
scheduleFromNow([=] { Repeat(*this, f, delta); }, delta);
|
scheduleFromNow([this, f, delta] { Repeat(*this, f, delta); }, delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t CScheduler::getQueueInfo(std::chrono::system_clock::time_point& first,
|
size_t CScheduler::getQueueInfo(std::chrono::system_clock::time_point& first,
|
||||||
|
|||||||
Reference in New Issue
Block a user