X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Scheduler%2FClockService.cci;h=89a6f9c26176a23dd877da5b44bc1d949d4266a0;hb=58e527462abb46e321c94fda65f758b67ac3aef2;hp=117e4754e2982492b7cac247dcefc7f7478b7429;hpb=e8b91aa6a817af6d9a3714e7b66be6c0d6b0a4e5;p=senf.git diff --git a/Scheduler/ClockService.cci b/Scheduler/ClockService.cci index 117e475..89a6f9c 100644 --- a/Scheduler/ClockService.cci +++ b/Scheduler/ClockService.cci @@ -1,8 +1,8 @@ // $Id$ // // Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// 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 @@ -24,7 +24,7 @@ \brief ClockService inline non-template implementation */ // Custom includes -#include "boost/date_time/posix_time/posix_time_types.hpp" +#include #define prefix_ inline ///////////////////////////////cci.p/////////////////////////////////////// @@ -118,6 +118,13 @@ prefix_ senf::ClockService::abstime_type senf::ClockService::abstime_m(clock_typ prefix_ senf::ClockService::clock_type senf::ClockService::clock_m(abstime_type time) { + ///\fixme What happens, if base_ is changed in SIGALRM while reading it here ? + + // Idea: Have *two* base values: one is written by the SIGALRM handler, the other is only + // Written by synchronous code. If they differ, we block signals, copy over and continue. If + // they transiently differ because we are reading the SIGALRM value while it is being changed + // this does not matter: We will then still copy it over. + boost::posix_time::time_duration delta (time - base_); return clock_type( delta.ticks() ) * clock_type( 1000000000UL / boost::posix_time::time_duration::ticks_per_second() );