| Patrick Williams | 0139cac | 2022-09-20 17:04:17 -0500 | [diff] [blame^] | 1 | #include <sdbusplus/async/scope.hpp> |
| 2 | |||||
| 3 | #include <exception> | ||||
| 4 | |||||
| 5 | namespace sdbusplus::async | ||||
| 6 | { | ||||
| 7 | scope::~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 | |||||
| 16 | void scope::started_task() noexcept | ||||
| 17 | { | ||||
| 18 | ++count; | ||||
| 19 | } | ||||
| 20 | |||||
| 21 | void scope::ended_task() noexcept | ||||
| 22 | { | ||||
| 23 | --count; | ||||
| 24 | } | ||||
| 25 | |||||
| 26 | } // namespace sdbusplus::async | ||||