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:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user