Added getActiveTasks() function to count how many tasks are running or suspended.

This commit is contained in:
2023-12-07 17:14:45 +01:00
parent 5e236dae00
commit 0e877f4769
2 changed files with 15 additions and 0 deletions

View File

@@ -542,6 +542,7 @@ public: // TaskLoop implementation
public: // public interface
[[nodiscard]] constexpr bool empty() const noexcept { return tasks_.empty() && newTasks_.empty(); }
[[nodiscard]] constexpr std::size_t getNumTasks() const noexcept { return tasks_.size() + newTasks_.size(); }
[[nodiscard]] std::size_t getActiveTasks() const noexcept;
inline CanContinue tick();
inline void runUntilDone(IgnoreWaiting ignoreWaiting = IgnoreWaiting::NO);
inline void cancelAllTasks() noexcept;