summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/ThreadPool.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2003-03-26 20:47:01 +0000
committerMarc Laukien <marc@zeroc.com>2003-03-26 20:47:01 +0000
commit9c56028a51dff53befc43a5829378645e9319778 (patch)
tree2bd091be88e647a93892652fdb3f9e092efe2487 /cpp/src/Ice/ThreadPool.cpp
parentbug fixes for sequence comparsion, local object impl (diff)
downloadice-9c56028a51dff53befc43a5829378645e9319778.tar.bz2
ice-9c56028a51dff53befc43a5829378645e9319778.tar.xz
ice-9c56028a51dff53befc43a5829378645e9319778.zip
vc++ 6.0 fix
Diffstat (limited to 'cpp/src/Ice/ThreadPool.cpp')
-rw-r--r--cpp/src/Ice/ThreadPool.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/cpp/src/Ice/ThreadPool.cpp b/cpp/src/Ice/ThreadPool.cpp
index be1ffb7372d..50b9adf3581 100644
--- a/cpp/src/Ice/ThreadPool.cpp
+++ b/cpp/src/Ice/ThreadPool.cpp
@@ -200,13 +200,14 @@ IceInternal::ThreadPool::joinWithAllThreads()
// threads would never terminate.)
//
assert(_destroyed);
- for_each(_threads.begin(), _threads.end(), mem_fun_ref(&IceUtil::ThreadControl::join));
-/*
+#if defined(_MSC_VER) && _MSC_VER <= 1200 // The mem_fun_ref below does not work with VC++ 6.0
for(vector<IceUtil::ThreadControl>::iterator p = _threads.begin(); p != _threads.end(); ++p)
{
p->join();
}
-*/
+#else
+ for_each(_threads.begin(), _threads.end(), mem_fun_ref(&IceUtil::ThreadControl::join));
+#endif
}
bool
@@ -566,10 +567,17 @@ IceInternal::ThreadPool::run()
assert(_running <= sz);
if(_running < sz)
{
- vector<IceUtil::ThreadControl>::iterator p =
+ vector<IceUtil::ThreadControl>::iterator start =
partition(_threads.begin(), _threads.end(), mem_fun_ref(&IceUtil::ThreadControl::isAlive));
- for_each(p, _threads.end(), mem_fun_ref(&IceUtil::ThreadControl::join));
- _threads.erase(p, _threads.end());
+#if defined(_MSC_VER) && _MSC_VER <= 1200 // The mem_fun_ref below does not work with VC++ 6.0
+ for(vector<IceUtil::ThreadControl>::iterator p = start; p != _threads.end(); ++p)
+ {
+ p->join();
+ }
+#else
+ for_each(start, _threads.end(), mem_fun_ref(&IceUtil::ThreadControl::join));
+#endif
+ _threads.erase(start, _threads.end());
}
//