Update bug_report.md
[ACE_TAO.git] / ACE / performance-tests / Synch-Benchmarks / Perf_Test / rwrd_test.cpp
blob12ee04bf97e46dc6e8ca73edcbbf335c6946557f
1 #define ACE_BUILD_SVC_DLL
2 #include "ace/RW_Mutex.h"
3 #include "Performance_Test_Options.h"
4 #include "Benchmark_Performance.h"
6 #if defined (ACE_HAS_THREADS)
8 class ACE_Svc_Export RWRD_Test : public Benchmark_Performance
10 public:
11 virtual int svc ();
13 private:
14 static ACE_RW_Mutex rw_lock;
17 ACE_RW_Mutex RWRD_Test::rw_lock;
19 int
20 RWRD_Test::svc ()
22 int ni = this->thr_id ();
23 synch_count = 2;
25 while (!this->done ())
27 rw_lock.acquire_read ();
28 performance_test_options.thr_work_count[ni]++;
29 buffer++;
30 rw_lock.release ();
33 /* NOTREACHED */
34 return 0;
37 ACE_SVC_FACTORY_DECLARE (RWRD_Test)
38 ACE_SVC_FACTORY_DEFINE (RWRD_Test)
40 // ACE_Service_Object_Type rwrdt (&rwrd_test, "RWRD_Mutex_Test");
41 #endif /* ACE_HAS_THREADS */