26 lines
515 B
C++
26 lines
515 B
C++
|
|
||
|
#include "clock_ab.h"
|
||
|
|
||
|
ClockAb::ClockAb(size_t myindex){
|
||
|
Glib::Mutex::Lock lock(_mutex);
|
||
|
printf("ClockAb::ClockAb -- constructor\n");
|
||
|
_cur_index = myindex;
|
||
|
_ticks = 0;
|
||
|
}
|
||
|
|
||
|
TimeStamp ClockAb::inc(){
|
||
|
// lock jusqu'a la fin de la fonction
|
||
|
Glib::Mutex::Lock lock(_mutex);
|
||
|
|
||
|
printf("ClockAb::inc -- creating timestamp\n");
|
||
|
_ticks++;
|
||
|
|
||
|
TimeStamp ts(Protocol::TYPE_ABCAST, _cur_index);
|
||
|
ts.push_back(_ticks);
|
||
|
return ts;
|
||
|
}
|
||
|
|
||
|
void ClockAb::adjust(TimeStamp ts){
|
||
|
printf("ClockAb::adjust -- NOT IMPLEMENTED\n");
|
||
|
}
|