Fixed network_worker to span at least one thread (bug #11238)

This commit is contained in:
Pauli Nieminen 2008-03-11 08:05:46 +00:00
parent bbc4c0bfb9
commit 0be2797764
2 changed files with 7 additions and 1 deletions

View file

@ -23,6 +23,7 @@ Version 1.5.0-svn:
* miscellaneous and bug fixes:
* wmlxgettext now print some context information about the strings
extracted (patch #993)
* Fixed network_worker to span at least one thread (bug #11238)
* more comprehensive terrain type naming to avoid confusing displays such
as 'Road (Grassland)' or 'Impassable mountain (Cavewall)'
This also applies to the WML keys used in the stats :

View file

@ -552,9 +552,14 @@ manager::manager(size_t p_min_threads,size_t p_max_threads) : active_(!managed)
min_threads = p_min_threads;
max_threads = p_max_threads;
if (p_min_threads == 0)
{
p_min_threads = 1;
}
for(int shard = 0; shard != NUM_SHARDS; ++shard) {
const threading::lock lock(*shard_mutexes[shard]);
for(size_t n = 0; n != min_threads; ++n) {
for(size_t n = 0; n != p_min_threads; ++n) {
threading::thread * tmp = new threading::thread(process_queue,(void*)intptr_t(shard));
threads[shard][tmp->get_id()] = tmp;
}