X-Git-Url: https://rtime.felk.cvut.cz/gitweb/l4.git/blobdiff_plain/5a0e6ead0fbfbb912cd817abad695c078e82481c..8d9e85aaae867f39cdd610261e3a4181c25add2d:/l4/pkg/l4re/util/include/event_buffer diff --git a/l4/pkg/l4re/util/include/event_buffer b/l4/pkg/l4re/util/include/event_buffer index d4a256baa..546c99a1d 100644 --- a/l4/pkg/l4re/util/include/event_buffer +++ b/l4/pkg/l4re/util/include/event_buffer @@ -96,13 +96,13 @@ public: * * \param cb Function callback. */ - template< typename CB > - void foreach_available_event(CB const &cb) throw() + template< typename CB, typename D > + void foreach_available_event(CB const &cb, D data = D()) throw() { typename Event_buffer_t::Event *e; while ((e = Event_buffer_t::next())) { - cb(e); + cb(e, data); e->free(); } } @@ -116,10 +116,10 @@ public: * * \note This function never returns. */ - template< typename CB > + template< typename CB, typename D > void process(L4::Cap irq, L4::Cap thread, - CB const &cb) throw() + CB const &cb, D data = D()) throw() { if (l4_error(irq->attach(0, thread))) @@ -133,7 +133,7 @@ public: if (r) continue; - foreach_available_event(cb); + foreach_available_event(cb, data); } } };