summaryrefslogtreecommitdiff
path: root/TAO/performance-tests/Callback/Callback_i.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/performance-tests/Callback/Callback_i.cpp')
-rw-r--r--TAO/performance-tests/Callback/Callback_i.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/TAO/performance-tests/Callback/Callback_i.cpp b/TAO/performance-tests/Callback/Callback_i.cpp
new file mode 100644
index 00000000000..1d7d30499ca
--- /dev/null
+++ b/TAO/performance-tests/Callback/Callback_i.cpp
@@ -0,0 +1,33 @@
+// $Id$
+
+#include "Callback_i.h"
+
+#if !defined(__ACE_INLINE__)
+#include "Callback_i.inl"
+#endif /* __ACE_INLINE__ */
+
+#include "ace/OS_NS_time.h"
+
+ACE_RCSID(Callback, Callback_i, "$Id$")
+
+int
+Callback_i::done (void)
+{
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->mutex_, 0);
+ return this->remaining_samples_ == 0;
+}
+
+void
+Callback_i::response (Test::TimeStamp time_stamp,
+ const Test::Payload &
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ ACE_hrtime_t now = ACE_OS::gethrtime ();
+ ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
+ if (this->remaining_samples_ == 0)
+ return;
+
+ this->remaining_samples_--;
+ this->history_.sample (ACE_HRTIME_TO_U64(now) - time_stamp);
+}