diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-05-21 17:57:38 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-05-21 17:57:38 +0000 |
commit | 5a826d6fd3c385705f0e070f18051d33e4810ea9 (patch) | |
tree | 04f02d4fb98c856d935a4948641081f709785ee4 /examples | |
parent | e3212b97863b1bdc700c575c0adb8fce6f3378e9 (diff) | |
download | ATCD-5a826d6fd3c385705f0e070f18051d33e4810ea9.tar.gz |
fixed to build without threads: #ifdef ACE_MT_SAFE is insufficient.
Must also check if it is 0.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp b/examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp index 7a98c2f1bd6..7b935dbb983 100644 --- a/examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp +++ b/examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp @@ -105,7 +105,9 @@ private: char oneway_; // Are we running oneway or twoway? - ACE_MT (ACE_Barrier *barrier_); + // Please leave the ; inside the parenthesis to avoid Green Hills + // (and probably other) compiler warning about extra ;. + ACE_MT (ACE_Barrier *barrier_;) // Barrier used to synchronize the start of all the threads. }; @@ -120,7 +122,7 @@ Options::Options (void) io_source_ (ACE_INVALID_HANDLE), // Defaults to using the generator. iterations_ (10000), oneway_ (1) // Make oneway calls the default. -#if defined (ACE_MT_SAFE) +#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) , barrier_ (0) #endif /* ACE_MT_SAFE */ { @@ -131,7 +133,7 @@ Options::~Options (void) ACE_MT (delete this->barrier_); delete [] this->message_buf_; } - + // Options Singleton. typedef ACE_Singleton<Options, ACE_SYNCH_RECURSIVE_MUTEX> OPTIONS; @@ -300,7 +302,7 @@ Options::shared_client_test (u_short port, ACE_DEBUG ((LM_DEBUG, "(%P|%t) waiting...\n")); - + // Wait for all other threads to finish initialization. ACE_MT (this->barrier_->wait ()); return buf; @@ -436,9 +438,9 @@ Options::twoway_client_test (void *) double messages_per_sec = iteration * double (ACE_ONE_SECOND_IN_USECS) / real_time; ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("(%t) messages = %d\n(%t) usec-per-message = %f\n(%t) messages-per-second = %0.00f\n"), - iteration, - real_time / double (iteration), + ASYS_TEXT ("(%t) messages = %d\n(%t) usec-per-message = %f\n(%t) messages-per-second = %0.00f\n"), + iteration, + real_time / double (iteration), messages_per_sec < 0 ? 0 : messages_per_sec)); // Close the connection. |