#include "common/Mutex.h"
#include "common/Finisher.h"
+#include "common/Formatter.h"
/**
* Manages a configurable number of asyncronous reservations.
do_queues();
}
+ void dump(Formatter *f) {
+ Mutex::Locker l(lock);
+ f->dump_unsigned("max_allowed", max_allowed);
+ f->dump_unsigned("min_priority", min_priority);
+ f->open_array_section("queues");
+ for (typename map<unsigned, list<pair<T, Context*> > > ::const_iterator p =
+ queues.begin(); p != queues.end(); ++p) {
+ f->open_object_section("queue");
+ f->dump_unsigned("priority", p->first);
+ f->open_array_section("items");
+ for (typename list<pair<T, Context*> >::const_iterator q =
+ p->second.begin(); q != p->second.end(); ++q) {
+ f->dump_stream("item") << q->first;
+ }
+ f->close_section();
+ f->close_section();
+ }
+ f->close_section();
+ f->open_array_section("in_progress");
+ for (typename set<T>::const_iterator p = in_progress.begin();
+ p != in_progress.end();
+ ++p) {
+ f->dump_stream("item") << *p;
+ }
+ f->close_section();
+ }
+
/**
* Requests a reservation
*