Merge pull request #2301 from sonndinh/remove-dup-reactor-functions
[ACE_TAO.git] / TAO / performance-tests / Callback / Callback_i.cpp
blob2a6f4ba31e29a24b0f3f91d24ac2cc298fcef50d
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 ()
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);