summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2007-06-07 05:58:10 +0000
committerMatthew Newhook <matthew@zeroc.com>2007-06-07 05:58:10 +0000
commit51f8b45557c6b28020c934cc9361b5c47e3de9d9 (patch)
treeaa271c661eadbebb791a77c8e11f2a2f1323f50d /cpp/src
parenthttp://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=2231 (diff)
downloadice-51f8b45557c6b28020c934cc9361b5c47e3de9d9.tar.bz2
ice-51f8b45557c6b28020c934cc9361b5c47e3de9d9.tar.xz
ice-51f8b45557c6b28020c934cc9361b5c47e3de9d9.zip
http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=2231. Fixed VC6 bug with
test/Freeze/complex test
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/Instance.cpp2
-rw-r--r--cpp/src/IceUtil/Cond.cpp26
-rwxr-xr-xcpp/src/slice2cs/Gen.cpp4
-rw-r--r--cpp/src/slice2java/Gen.cpp2
-rw-r--r--cpp/src/slice2javae/Gen.cpp2
-rwxr-xr-xcpp/src/slice2vb/Gen.cpp2
6 files changed, 17 insertions, 21 deletions
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp
index c450d48046c..d4ae7b27c76 100644
--- a/cpp/src/Ice/Instance.cpp
+++ b/cpp/src/Ice/Instance.cpp
@@ -608,7 +608,7 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi
Int num = _initData.properties->getPropertyAsIntWithDefault("Ice.MessageSizeMax", defaultMessageSizeMax);
if(num < 1)
{
- const_cast<size_t&>(_messageSizeMax) = defaultMessageSizeMax * 1024; // Ignore stupid values.
+ const_cast<size_t&>(_messageSizeMax) = defaultMessageSizeMax * 1024; // Ignore non-sensical values.
}
else if(static_cast<size_t>(num) > (size_t)(0x7fffffff / 1024))
{
diff --git a/cpp/src/IceUtil/Cond.cpp b/cpp/src/IceUtil/Cond.cpp
index 87f27e1e413..f53d338191c 100644
--- a/cpp/src/IceUtil/Cond.cpp
+++ b/cpp/src/IceUtil/Cond.cpp
@@ -80,10 +80,7 @@ IceUtil::Semaphore::post(int count) const
// because _blocked is protected by the _gate, whereas _unblocked is
// protected by the _internal mutex. There is an assumption here about
// memory visibility since postWait does not itself acquire the _gate
-// semaphore (note that the _gate must be held if _toUnblock != 0).
-//
-// _toUnblock is a tri-state variable. 0 is no signal/broadcast
-// pending. -1 is signal pending. 1 is a broadcast pending.
+// semaphore (note that the _gate must be held if _state != StateIdle).
//
// Threads timing out present a particular issue because they may have
// woken without a corresponding notification and its easy to leave
@@ -96,7 +93,7 @@ IceUtil::Cond::Cond() :
_gate(1),
_blocked(0),
_unblocked(0),
- _toUnblock(0)
+ _state(IceUtil::Cond::StateIdle)
{
}
@@ -140,9 +137,8 @@ IceUtil::Cond::wake(bool broadcast)
}
//
- // If there are blocked threads then we set _toUnblock to the
- // number of waiting threads if broadcast was called, or 1 if
- // signal is called.
+ // If there are waiting threads then we enter a signal or
+ // broadcast state.
//
if(_blocked > 0)
{
@@ -150,8 +146,8 @@ IceUtil::Cond::wake(bool broadcast)
// Unblock some number of waiters. We use -1 for the signal
// case.
//
- assert(_toUnblock == 0);
- _toUnblock = (broadcast) ? 1 : -1;
+ assert(_state == StateIdle);
+ _state = (broadcast) ? StateBroadcast : StateSignal;
//
// Posting the queue wakes a single waiting thread. After this
// occurs the waiting thread will wake and then either post on
@@ -201,10 +197,10 @@ IceUtil::Cond::postWait(bool timedOutOrFailed) const
_unblocked++;
//
- // If _toUnblock is 0 then this must be a timeout, otherwise its a
+ // If _state is StateIdle then this must be a timeout, otherwise its a
// spurious wakeup which is incorrect.
//
- if(_toUnblock == 0)
+ if(_state == StateIdle)
{
assert(timedOutOrFailed);
return;
@@ -219,7 +215,7 @@ IceUtil::Cond::postWait(bool timedOutOrFailed) const
//
if(_blocked == _unblocked)
{
- _toUnblock = 0;
+ _state = StateIdle;
//
// Consume the queue post to prevent spurious wakeup. Note
// that although the internal mutex could be released
@@ -243,9 +239,9 @@ IceUtil::Cond::postWait(bool timedOutOrFailed) const
// At this point, the thread must have been woken up because
// of a signal/broadcast.
//
- if(_toUnblock == -1 || _blocked == _unblocked) // Signal or broadcast and no more blocked threads
+ if(_state == StateSignal || _blocked == _unblocked) // Signal or no more blocked threads
{
- _toUnblock = 0;
+ _state = StateIdle;
// Release before posting to avoid potential immediate
// context switch due to the mutex being locked.
sync.release();
diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp
index c7f74e80780..341d2d52489 100755
--- a/cpp/src/slice2cs/Gen.cpp
+++ b/cpp/src/slice2cs/Gen.cpp
@@ -27,8 +27,8 @@ using namespace std;
using namespace Slice;
//
-// Don't use "using namespace IceUtil", or stupid VC++ 6.0 complains
-// about ambigious symbols for constructs like
+// Don't use "using namespace IceUtil", or VC++ 6.0 complains about
+// ambigious symbols for constructs like
// "IceUtil::constMemFun(&Slice::Exception::isLocal)".
//
using IceUtil::Output;
diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp
index a8a5c62316f..6227aee3b95 100644
--- a/cpp/src/slice2java/Gen.cpp
+++ b/cpp/src/slice2java/Gen.cpp
@@ -20,7 +20,7 @@ using namespace std;
using namespace Slice;
//
-// Don't use "using namespace IceUtil", or stupid VC++ 6.0 complains
+// Don't use "using namespace IceUtil", or VC++ 6.0 complains
// about ambigious symbols for constructs like
// "IceUtil::constMemFun(&Slice::Exception::isLocal)".
//
diff --git a/cpp/src/slice2javae/Gen.cpp b/cpp/src/slice2javae/Gen.cpp
index a00430a9107..9a6447226b6 100644
--- a/cpp/src/slice2javae/Gen.cpp
+++ b/cpp/src/slice2javae/Gen.cpp
@@ -19,7 +19,7 @@ using namespace std;
using namespace Slice;
//
-// Don't use "using namespace IceUtil", or stupid VC++ 6.0 complains
+// Don't use "using namespace IceUtil", or VC++ 6.0 complains
// about ambigious symbols for constructs like
// "IceUtil::constMemFun(&Slice::Exception::isLocal)".
//
diff --git a/cpp/src/slice2vb/Gen.cpp b/cpp/src/slice2vb/Gen.cpp
index 8199e87d3c0..2cbb6103d1c 100755
--- a/cpp/src/slice2vb/Gen.cpp
+++ b/cpp/src/slice2vb/Gen.cpp
@@ -27,7 +27,7 @@ using namespace std;
using namespace Slice;
//
-// Don't use "using namespace IceUtil", or stupid VC++ 6.0 complains
+// Don't use "using namespace IceUtil", or VC++ 6.0 complains
// about ambigious symbols for constructs like
// "IceUtil::constMemFun(&Slice::Exception::isLocal)".
//