From 1d796e6cf639354614f1152baab65d317271c357 Mon Sep 17 00:00:00 2001 From: Pixel Date: Wed, 16 Nov 2011 17:26:28 -0800 Subject: Kind of a big revamp of the TaskMan / Task model, in order to introduce a TaskScheduler. The idea is that we need to support multiple task managers from multiple threads. So that revamp means we now should be able to support that, except the TaskScheduler needs to implement a round robin system, to distribute tasks across multiple task managers. But at least, the fundamental redesign to permit this is here. --- includes/Threads.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'includes/Threads.h') diff --git a/includes/Threads.h b/includes/Threads.h index 2347a84..a1f270e 100644 --- a/includes/Threads.h +++ b/includes/Threads.h @@ -57,6 +57,13 @@ class Queue { m_lock.leave(); return t; } + int size() { + int r; + m_lock.enter(); + r = m_queue.size(); + m_lock.leave(); + return r; + } private: std::queue m_queue; Lock m_lock; -- cgit v1.2.3