Changes in src/libcfa/concurrency/alarm.h [c40e7c5:b69ea6b]
- File:
-
- 1 edited
-
src/libcfa/concurrency/alarm.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/alarm.h
rc40e7c5 rb69ea6b 21 21 #include <assert.h> 22 22 23 #include "bits/cfatime.h" 24 23 25 struct thread_desc; 24 26 struct processor; 25 26 struct timespec;27 struct itimerval;28 29 //=============================================================================================30 // time type31 //=============================================================================================32 33 struct __cfa_time_t {34 uint64_t val;35 };36 37 // ctors38 void ?{}( __cfa_time_t & this );39 void ?{}( __cfa_time_t & this, zero_t zero );40 void ?{}( __cfa_time_t & this, timespec * curr );41 void ?{}( itimerval & this, __cfa_time_t * alarm );42 43 __cfa_time_t ?=?( __cfa_time_t & this, zero_t rhs );44 45 // logical ops46 static inline bool ?==?( __cfa_time_t lhs, __cfa_time_t rhs ) { return lhs.val == rhs.val; }47 static inline bool ?!=?( __cfa_time_t lhs, __cfa_time_t rhs ) { return lhs.val != rhs.val; }48 static inline bool ?>? ( __cfa_time_t lhs, __cfa_time_t rhs ) { return lhs.val > rhs.val; }49 static inline bool ?<? ( __cfa_time_t lhs, __cfa_time_t rhs ) { return lhs.val < rhs.val; }50 static inline bool ?>=?( __cfa_time_t lhs, __cfa_time_t rhs ) { return lhs.val >= rhs.val; }51 static inline bool ?<=?( __cfa_time_t lhs, __cfa_time_t rhs ) { return lhs.val <= rhs.val; }52 53 static inline bool ?==?( __cfa_time_t lhs, zero_t rhs ) { return lhs.val == rhs; }54 static inline bool ?!=?( __cfa_time_t lhs, zero_t rhs ) { return lhs.val != rhs; }55 static inline bool ?>? ( __cfa_time_t lhs, zero_t rhs ) { return lhs.val > rhs; }56 static inline bool ?<? ( __cfa_time_t lhs, zero_t rhs ) { return lhs.val < rhs; }57 static inline bool ?>=?( __cfa_time_t lhs, zero_t rhs ) { return lhs.val >= rhs; }58 static inline bool ?<=?( __cfa_time_t lhs, zero_t rhs ) { return lhs.val <= rhs; }59 60 // addition/substract61 static inline __cfa_time_t ?+?( __cfa_time_t lhs, __cfa_time_t rhs ) {62 __cfa_time_t ret;63 ret.val = lhs.val + rhs.val;64 return ret;65 }66 67 static inline __cfa_time_t ?-?( __cfa_time_t lhs, __cfa_time_t rhs ) {68 __cfa_time_t ret;69 ret.val = lhs.val - rhs.val;70 return ret;71 }72 73 __cfa_time_t from_s ( uint64_t );74 __cfa_time_t from_ms( uint64_t );75 __cfa_time_t from_us( uint64_t );76 __cfa_time_t from_ns( uint64_t );77 78 extern __cfa_time_t zero_time;79 27 80 28 //============================================================================================= … … 105 53 typedef alarm_node_t ** __alarm_it_t; 106 54 107 void ?{}( alarm_node_t & this, thread_desc * thrd, __cfa_time_t alarm = zero_time, __cfa_time_t period = zero_time);108 void ?{}( alarm_node_t & this, processor * proc, __cfa_time_t alarm = zero_time, __cfa_time_t period = zero_time);55 void ?{}( alarm_node_t & this, thread_desc * thrd, __cfa_time_t alarm = 0`cfa_s, __cfa_time_t period = 0`cfa_s ); 56 void ?{}( alarm_node_t & this, processor * proc, __cfa_time_t alarm = 0`cfa_s, __cfa_time_t period = 0`cfa_s ); 109 57 void ^?{}( alarm_node_t & this ); 110 58
Note:
See TracChangeset
for help on using the changeset viewer.