X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Scheduler%2FScheduler.cc;h=9ed26e2ea3bbd8adaa435e3153b13bf85da56500;hb=51044eb18f034c1a059ffe2fb109a422c1cbe251;hp=1afc018e960aa63fc1babd2ea36fa2d53b5c9acb;hpb=f358cbf3cb00759bc8e55ab13d4b50040c49b133;p=senf.git diff --git a/Scheduler/Scheduler.cc b/Scheduler/Scheduler.cc index 1afc018..9ed26e2 100644 --- a/Scheduler/Scheduler.cc +++ b/Scheduler/Scheduler.cc @@ -1,9 +1,9 @@ // $Id$ // // Copyright (C) 2006 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) -// Stefan Bund +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -42,6 +42,7 @@ //#include "Scheduler.ih" // Custom includes +#include "../Utils/senfassert.hh" #include #include #include @@ -58,24 +59,24 @@ prefix_ senf::Scheduler::Scheduler() eventTime_(0), eventEarly_(ClockService::milliseconds(11)), eventAdjust_(0) { if (epollFd_<0) - throw SystemException(errno); + throwErrno(); if (::pipe(sigpipe_) < 0) - throw SystemException(errno); + throwErrno(); int flags (::fcntl(sigpipe_[1],F_GETFL)); if (flags < 0) - throw SystemException(errno); + throwErrno(); flags |= O_NONBLOCK; if (::fcntl(sigpipe_[1], F_SETFL, flags) < 0) - throw SystemException(errno); + throwErrno(); ::epoll_event ev; ::memset(&ev, 0, sizeof(ev)); ev.events = EV_READ; ev.data.fd = sigpipe_[0]; if (::epoll_ctl(epollFd_, EPOLL_CTL_ADD, sigpipe_[0], &ev) < 0) - throw SystemException(errno); + throwErrno(); } prefix_ void senf::Scheduler::registerSignal(unsigned signal, SimpleCallback const & cb) @@ -181,7 +182,7 @@ prefix_ void senf::Scheduler::registerSigHandlers() if (signal == SIGCHLD) sa.sa_flags |= SA_NOCLDSTOP; if (::sigaction(signal, &sa, 0) < 0) - throw SystemException(errno); + throwErrno(); } } } @@ -254,7 +255,7 @@ prefix_ void senf::Scheduler::process() if (events<0) if (errno != EINTR) - throw SystemException(errno); + throwErrno(); eventTime_ = ClockService::now(); @@ -301,15 +302,15 @@ prefix_ void senf::Scheduler::process() if (mask & EPOLLERR) extraFlags |= EV_ERR; if (mask & EPOLLIN) { - BOOST_ASSERT(spec.cb_read); + SENF_ASSERT(spec.cb_read); spec.cb_read(EventId(EV_READ | extraFlags)); } else if (mask & EPOLLPRI) { - BOOST_ASSERT(spec.cb_prio); + SENF_ASSERT(spec.cb_prio); spec.cb_prio(EventId(EV_PRIO | extraFlags)); } else if (mask & EPOLLOUT) { - BOOST_ASSERT(spec.cb_write); + SENF_ASSERT(spec.cb_write); spec.cb_write(EventId(EV_WRITE | extraFlags)); } else {