// Free Software Foundation, Inc.,
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-// TODO: Implement signal handling
+/** \file
+
+ \idea Implement signal handling (See source for more discussion
+ about this)
+
+ \idea Multithreading support: To support multithreading, the
+ static member Scheduler::instance() must return a thread-local
+ value (that is Scheduler::instance() must allocate one Scheduler
+ instance per thread)
+
+ \fixme Test2
+ */
+
// Here a basic concept of how to add signal support to the scheduler:
//
// Every signal to be reported by the scheduler will be asigned a
// scheduler must be blocked as soon as it is registered with the
// scheduler.
-// TODO: Multithreading support
-// To support multithreading, the static member Scheduler::instance()
-// must return a thread-local value (that is Scheduler::instance()
-// must allocate one Scheduler instance per thread)
-
// Definition of non-inline non-template functions
#include "Scheduler.hh"
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
-prefix_ satcom::lib::Scheduler::Scheduler & satcom::lib::Scheduler::instance()
+prefix_ senf::Scheduler::Scheduler & senf::Scheduler::instance()
{
static Scheduler instance;
return instance;
}
-prefix_ void satcom::lib::Scheduler::timeout(unsigned long timeout, TimerCallback const & cb)
+prefix_ void senf::Scheduler::timeout(unsigned long timeout, TimerCallback const & cb)
{
timerQueue_.push(TimerSpec(now()+1000*timeout,cb));
}
-prefix_ satcom::lib::Scheduler::Scheduler()
+prefix_ senf::Scheduler::Scheduler()
: epollFd_(epoll_create(EPollInitialSize))
{
if (epollFd_<0)
throw SystemException(errno);
}
-prefix_ void satcom::lib::Scheduler::do_add(int fd, SimpleCallback const & cb, int eventMask)
+prefix_ void senf::Scheduler::do_add(int fd, SimpleCallback const & cb, int eventMask)
{
FdTable::iterator i (fdTable_.find(fd));
int action (EPOLL_CTL_MOD);
throw SystemException(errno);
}
-prefix_ void satcom::lib::Scheduler::do_remove(int fd, int eventMask)
+prefix_ void senf::Scheduler::do_remove(int fd, int eventMask)
{
FdTable::iterator i (fdTable_.find(fd));
if (i == fdTable_.end())
}
-prefix_ int satcom::lib::Scheduler::EventSpec::epollMask()
+prefix_ int senf::Scheduler::EventSpec::epollMask()
const
{
int mask (0);
return mask;
}
-prefix_ void satcom::lib::Scheduler::process()
+prefix_ void senf::Scheduler::process()
{
terminate_ = false;
while (! terminate_) {
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// c-file-style: "senf"
// End: