Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / performance-tests / Callback / Callback_i.cpp
blob6c8b0a5a99745fc0ac0110d2c6a790b778fa7f03
1 #include "Callback_i.h"
3 #if !defined(__ACE_INLINE__)
4 #include "Callback_i.inl"
5 #endif /* __ACE_INLINE__ */
7 #include "ace/OS_NS_time.h"
9 int
10 Callback_i::done (void)
12 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, 0);
13 return this->remaining_samples_ == 0;
16 void
17 Callback_i::response (Test::TimeStamp time_stamp,
18 const Test::Payload &)
20 ACE_hrtime_t now = ACE_OS::gethrtime ();
21 ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
22 if (this->remaining_samples_ == 0)
23 return;
25 this->remaining_samples_--;
26 this->history_.sample (ACE_HRTIME_TO_U64(now) - time_stamp);