1 #define ACE_BUILD_SVC_DLL
2 #include "Performance_Test_Options.h"
3 #include "Benchmark_Performance.h"
5 #if defined (ACE_HAS_THREADS)
7 class ACE_Svc_Export Cond_Signal_Test
: public Benchmark_Performance
13 static ACE_Thread_Mutex mutex
;
16 static ACE_Condition_Thread_Mutex notfull
;
17 static ACE_Condition_Thread_Mutex notempty
;
20 ACE_Thread_Mutex
Cond_Signal_Test::mutex
;
21 int Cond_Signal_Test::resources
;
22 ACE_Condition_Thread_Mutex
Cond_Signal_Test::notfull (Cond_Signal_Test::mutex
);
23 ACE_Condition_Thread_Mutex
Cond_Signal_Test::notempty (Cond_Signal_Test::mutex
);
26 Cond_Signal_Test::svc ()
28 int ni
= this->thr_id ();
31 // This is a horrible hack and only works for Solaris threads. This
32 // clearly needs to change...
34 while (!this->done ())
41 performance_test_options
.thr_work_count
[ni
]++;
42 resources
= performance_test_options
.thr_count () - 1;
48 while (!this->done ())
51 while (resources
== 0)
53 performance_test_options
.thr_work_count
[ni
]++;
64 ACE_SVC_FACTORY_DECLARE (Cond_Signal_Test
)
65 ACE_SVC_FACTORY_DEFINE (Cond_Signal_Test
)
67 // ACE_Service_Object_Type cst (&cond_signal_test, "Condition_Signal_Test");
68 #endif /* ACE_HAS_THREADS */