diff options
author | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-08-30 08:39:11 +0000 |
---|---|---|
committer | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-08-30 08:39:11 +0000 |
commit | 3e8496d3b86d5b606dbe646b19294d56a86bb0c4 (patch) | |
tree | 72c589632c8f6f28074c6558fd8a80080689bc27 /performance-tests/Synch-Benchmarks/Perf_Test/sysvsema_test.cpp | |
parent | 9bb064cf0c12f2d5bd9d4964b2ce92aae6a0c69d (diff) | |
download | ATCD-3e8496d3b86d5b606dbe646b19294d56a86bb0c4.tar.gz |
Reorganizing the directory
Diffstat (limited to 'performance-tests/Synch-Benchmarks/Perf_Test/sysvsema_test.cpp')
-rw-r--r-- | performance-tests/Synch-Benchmarks/Perf_Test/sysvsema_test.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/performance-tests/Synch-Benchmarks/Perf_Test/sysvsema_test.cpp b/performance-tests/Synch-Benchmarks/Perf_Test/sysvsema_test.cpp new file mode 100644 index 00000000000..95b8cda7c2f --- /dev/null +++ b/performance-tests/Synch-Benchmarks/Perf_Test/sysvsema_test.cpp @@ -0,0 +1,46 @@ +// $Id$ + +#define ACE_BUILD_SVC_DLL +#include "ace/SV_Semaphore_Simple.h" +#include "Performance_Test_Options.h" +#include "Benchmark_Performance.h" + +ACE_RCSID(Synch_Benchmarks, sysvsema_test, "$Id$") + +#if defined (ACE_HAS_THREADS) + +class ACE_Svc_Export SYSVSema_Test : public Benchmark_Performance +{ +public: + virtual int svc (void); + +private: + static ACE_SV_Semaphore_Simple sema; +}; + +ACE_SV_Semaphore_Simple SYSVSema_Test::sema ((key_t) 1234); + +int +SYSVSema_Test::svc (void) +{ + int ni = this->thr_id (); + synch_count = 2; + + while (!this->done ()) + { + sema.acquire (); + options.thr_work_count[ni]++; + buffer++; + sema.release (); + } + + sema.remove (); + /* NOTREACHED */ + return 0; +} + +ACE_SVC_FACTORY_DECLARE (SYSVSema_Test) +ACE_SVC_FACTORY_DEFINE (SYSVSema_Test) + +// ACE_Service_Object_Type st (&sysvsema_test, "SYSVSema_Test"); +#endif /* ACE_HAS_THREADS */ |