1 #if !defined (SYNCHLIB_BUILD_DLL)
2 #define SYNCHLIB_BUILD_DLL
3 #endif /* SYNCHLIB_BUILD_DLL */
5 #include "ace/Log_Msg.h"
6 #include "Benchmark_Base.h"
8 #if defined (ACE_HAS_THREADS)
10 // Initialize the static variables.
13 Benchmark_Base::Benchmark_Base (int type
)
14 : benchmark_type_ (type
)
19 Benchmark_Base::benchmark_type ()
21 return this->benchmark_type_
;
25 Benchmark_Base::thr_id ()
27 #if defined (ACE_HAS_PTHREADS) || defined (VXWORKS)
28 // This invokes the thread-specific storage smart pointer.
29 return this->id_
->thr_id ();
31 return ACE_Thread::self ();
32 #endif /* ACE_HAS_PTHREADS || VXWORKS */
35 Benchmark_Method_Base::Benchmark_Method_Base ()
36 : Benchmark_Base (Benchmark_Base::METHOD
)
41 Benchmark_Method_Base::exec (ACE_Service_Repository_Iterator
*sri
)
44 for (const ACE_Service_Type
*sr
;
48 // This would greatly benefit from RTTI typesafe downcasting...
49 const ACE_Service_Type_Impl
*type
= sr
->type ();
50 const void *obj
= type
->object ();
51 ACE_Service_Object
*so
= (ACE_Service_Object
*) obj
;
52 Benchmark_Base
*bp
= (Benchmark_Base
*) so
;
54 if (this->valid_test_object (bp
))
56 ACE_DEBUG ((LM_DEBUG
, "\nstarting up %s\n", sr
->name ()));
58 int notused
= this->pre_run_test (bp
) == 0 && this->run_test () == 0 &&
59 this->post_run_test () == 0;
68 #if defined (ACE_HAS_PTHREADS) || defined (VXWORKS)
70 MT_INT
Thr_ID::thread_id_ (0);
73 : thr_id_ (++Thr_ID::thread_id_
)
84 Thr_ID::thr_id (int i
)
89 #endif /* ACE_HAS_PTHREADS || VXWORKS */
90 #endif /* ACE_HAS_THREADS */