These are better when the list may need to be deallocated. Context's are
single-shot and the list is not referenced by the caller.
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
(*it)->Signal();
}
+void Client::wait_on_context_list(list<Context*>& ls)
+{
+ Cond cond;
+ bool done = false;
+ int r;
+ ls.push_back(new C_Cond(&cond, &done, &r));
+ while (!done)
+ cond.Wait(client_lock);
+}
+
+void Client::signal_context_list(list<Context*>& ls)
+{
+ while (!ls.empty()) {
+ ls.front()->complete(0);
+ ls.pop_front();
+ }
+}
+
void Client::wake_inode_waiters(MetaSession *s)
{
xlist<Cap*>::iterator iter = s->caps.begin();
void wait_on_list(list<Cond*>& ls);
void signal_cond_list(list<Cond*>& ls);
+ void wait_on_context_list(list<Context*>& ls);
+ void signal_context_list(list<Context*>& ls);
+
// -- metadata cache stuff
// decrease inode ref. delete if dangling.