NEW FILE HEADER / COPYRIGHT FORMAT
[senf.git] / Scheduler / ClockService.cci
index 117e475..89a6f9c 100644 (file)
@@ -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 <g0dil@berlios.de>
 //
 // 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 <boost/date_time/posix_time/posix_time_types.hpp>
 
 #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() );