Update bug_report.md
[ACE_TAO.git] / ACE / performance-tests / Synch-Benchmarks / Perf_Test / adaptive_sema_test.cpp
blob4c7ce00d9ca2b4a15827f4865e51b0c213a4d7be
1 #define ACE_BUILD_SVC_DLL
2 #include "ace/Log_Msg.h"
3 #include "Adaptive_Lock_Performance_Test_Base.h"
4 #include "ace/Semaphore.h"
5 #include "ace/Lock_Adapter_T.h"
7 #if defined (ACE_HAS_THREADS)
9 class ACE_Svc_Export Adaptive_Sema_Test : public Adaptive_Lock_Performance_Test_Base
11 public:
12 virtual int init (int, ACE_TCHAR *[]);
14 private:
15 static ACE_Semaphore sema;
18 ACE_Semaphore Adaptive_Sema_Test::sema (1);
20 int
21 Adaptive_Sema_Test::init (int, ACE_TCHAR *[])
23 ACE_Lock *lock;
24 ACE_NEW_RETURN (lock,
25 ACE_Lock_Adapter<ACE_Semaphore> (Adaptive_Sema_Test::sema),
26 -1);
28 return this->set_lock (lock);
31 ACE_SVC_FACTORY_DECLARE (Adaptive_Sema_Test)
32 ACE_SVC_FACTORY_DEFINE (Adaptive_Sema_Test)
34 #endif /* ACE_HAS_THREADS */