summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-05-21 17:57:38 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-05-21 17:57:38 +0000
commit3f65e96b4adb5e4154a4e1514c9e536667ecabb3 (patch)
tree04f02d4fb98c856d935a4948641081f709785ee4
parentefcb2042d20092dcd371b4879cfe9cd1bd2facb6 (diff)
downloadATCD-3f65e96b4adb5e4154a4e1514c9e536667ecabb3.tar.gz
fixed to build without threads: #ifdef ACE_MT_SAFE is insufficient.
Must also check if it is 0.
-rw-r--r--examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp16
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.