Cleanup ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE, all platforms support it so far as I can...
[ACE_TAO.git] / ACE / performance-tests / Synch-Benchmarks / Perf_Test / token_test.cpp
blob45e462a779214f33156564915e4cc08382d1484c
1 #define ACE_BUILD_SVC_DLL
2 #include "ace/Token.h"
3 #include "Performance_Test_Options.h"
4 #include "Benchmark_Performance.h"
6 #if defined (ACE_HAS_THREADS)
8 class ACE_Svc_Export Token_Test : public Benchmark_Performance
10 public:
11 virtual int svc ();
13 private:
14 static ACE_Token token;
17 ACE_Token Token_Test::token;
19 int
20 Token_Test::svc ()
22 // Extract out the unique thread-specific value to be used as an
23 // index...
24 int ni = this->thr_id ();
25 synch_count = 2;
27 while (!this->done ())
29 token.acquire ();
30 performance_test_options.thr_work_count[ni]++;
31 buffer++;
32 token.release ();
34 /* NOTREACHED */
35 return 0;
38 ACE_SVC_FACTORY_DECLARE (Token_Test)
39 ACE_SVC_FACTORY_DEFINE (Token_Test)
41 // ACE_Service_Object_Type tok (&token_test, "Token_Test");
42 #endif /* ACE_HAS_THREADS */