Changes I made in the l4-sys experiment recently, plus one minor style fix

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1584 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
unzner
2012-09-01 16:05:22 +00:00
parent 1e53a7c0de
commit d9b24a7c60
8 changed files with 130 additions and 68 deletions

View File

@ -164,19 +164,16 @@ void JobServer::run()
// Spawn a thread for further communication,
// and add this thread to a list threads
// We can limit the generation of threads here.
if (m_threadlist.size() < m_maxThreads) {
th = new boost::thread(CommThread(cs, *this));
m_threadlist.push_back(th);
} else {
if (m_threadlist.size() >= m_maxThreads) {
// Run over list with a timed_join,
// removing finished threads.
do {
m_threadlist.remove_if(timed_join_successful(m_threadtimeout));
} while(m_threadlist.size() == m_maxThreads);
}
// Start new thread
th = new boost::thread(CommThread(cs, *this));
m_threadlist.push_back(th);
}
}
close(s);