blob: efdc5f681625a94bcca025cac5210adbe8ab0440 [file] [log] [blame]
Patrick Williams0139cac2022-09-20 17:04:17 -05001#include <sdbusplus/async/scope.hpp>
2
3#include <exception>
4
5namespace sdbusplus::async
6{
7scope::~scope() noexcept(false)
8{
9 if (count != 0)
10 {
11 throw std::logic_error(
12 "sdbusplus::async::scope destructed while tasks are pending.");
13 }
14}
15
16void scope::started_task() noexcept
17{
18 ++count;
19}
20
21void scope::ended_task() noexcept
22{
23 --count;
24}
25
26} // namespace sdbusplus::async