From 57fec451b1858ff1e097ec9e91a07f849952ab78 Mon Sep 17 00:00:00 2001 From: nanbor Date: Tue, 9 Oct 2001 19:02:45 +0000 Subject: ChangeLogTag:Tue Oct 09 14:00:46 2001 Nanbor Wang --- .../Cubit/TAO/IDL_Cubit/collocation_test.cpp | 23 ++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'TAO/performance-tests') diff --git a/TAO/performance-tests/Cubit/TAO/IDL_Cubit/collocation_test.cpp b/TAO/performance-tests/Cubit/TAO/IDL_Cubit/collocation_test.cpp index 77a212bec3b..ece59a9223c 100644 --- a/TAO/performance-tests/Cubit/TAO/IDL_Cubit/collocation_test.cpp +++ b/TAO/performance-tests/Cubit/TAO/IDL_Cubit/collocation_test.cpp @@ -14,13 +14,24 @@ ACE_RCSID(IDL_Cubit, collocation_test, "$Id$") #define THE_IOR "theior" +struct Barriers +{ + Barriers (unsigned int init) + : server_init_ (init), + client_fini_ (init) + {} + + ACE_Barrier server_init_; + ACE_Barrier client_fini_; +}; + static const char *server_cmd = 0; void * svr_worker (void *arg) { Cubit_Server cubit_server; - ACE_Barrier *barrier = (ACE_Barrier *) arg; + Barriers *barrier = (Barriers *) arg; char cmd_line[1024]; ACE_OS::strcpy (cmd_line, "server "); @@ -39,11 +50,11 @@ svr_worker (void *arg) if (result == -1) return (void *) 1; - barrier[0].wait (); + barrier->server_init_.wait (); cubit_server.run (ACE_TRY_ENV); ACE_TRY_CHECK; - barrier[1].wait (); + barrier->client_fini_.wait (); } ACE_CATCH (CORBA::SystemException, sysex) { @@ -91,7 +102,7 @@ main (int argc, char **argv) ACE_OS::strcat (cmd_line, " -f " THE_IOR); ACE_ARGV args (cmd_line); - ACE_Barrier barrier [2] = {2, 2}; + Barriers barrier (2); int retv = 1; @@ -101,7 +112,7 @@ main (int argc, char **argv) ACE_Thread_Manager tm; tm.spawn (ACE_reinterpret_cast (ACE_THR_FUNC, &svr_worker), &barrier); - barrier[0].wait (); + barrier.server_init_.wait (); ACE_OS::sleep (1); Cubit_Client cubit_client (1); @@ -112,7 +123,7 @@ main (int argc, char **argv) else retv = cubit_client.run (); - barrier[1].wait (); + barrier.client_fini_.wait (); tm.wait (); ACE_OS::unlink (THE_IOR); -- cgit v1.2.1