Module: sems
Branch: master
Commit: 230be2c34255c60e6ee3b17e030fb1d684fe8aaf
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=230be2c34255c60e6ee3b17e030fb1d684fe8aaf

Author: Raphael Coeffic <[email protected]>
Committer: Raphael Coeffic <[email protected]>
Date:   Wed Mar  6 12:46:30 2013 +0100

sip: added public unix timestamp for general use

---

 core/sip/wheeltimer.cpp |    3 +++
 core/sip/wheeltimer.h   |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/core/sip/wheeltimer.cpp b/core/sip/wheeltimer.cpp
index 224500b..707af65 100644
--- a/core/sip/wheeltimer.cpp
+++ b/core/sip/wheeltimer.cpp
@@ -100,6 +100,9 @@ void _wheeltimer::run()
     //printf("missed one tick\n");
     //}
 
+    gettimeofday(&now,NULL);
+    unix_clock.set(now.tv_sec);
+
     turn_wheel();
     timeradd(&tick,&next_tick,&next_tick);
   }
diff --git a/core/sip/wheeltimer.h b/core/sip/wheeltimer.h
index f5b3c1d..b17ad71 100644
--- a/core/sip/wheeltimer.h
+++ b/core/sip/wheeltimer.h
@@ -34,6 +34,8 @@
 #include <sys/types.h>
 #include <deque>
 
+#include "atomic_types.h"
+
 #define BITS_PER_WHEEL 8
 #define ELMTS_PER_WHEEL (1 << BITS_PER_WHEEL)
 
@@ -117,6 +119,7 @@ protected:
 public:
     //clock reference
     volatile u_int32_t wall_clock; // 32 bits
+    atomic_int64 unix_clock; // 64 bits
 
     void insert_timer(timer* t);
     void remove_timer(timer* t);

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to