Ignore:
Timestamp:
04/07/15 04:20:14 (9 years ago)
Author:
Maciej Komosinski
Message:

Each thread can use its own simulator's GenMan?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/geno.cpp

    r286 r346  
    77#include <frams/model/model.h>
    88
    9 SListTempl<GenoValidator*> Geno::validators;
    109GenoConvManager *Geno::converters = NULL;
     10
     11THREAD_LOCAL_DEF(Geno::Validators, geno_validators);
     12
     13Geno::Validators& Geno::getValidators() {return tlsGetRef(geno_validators);}
    1114
    1215void Geno::init(const SString& genstring, char genformat, const SString& genname, const SString& comment)
     
    234237        if (isvalid >= 0) return;
    235238        if (gen.len() == 0) { isvalid = 0; return; }
    236         FOREACH(GenoValidator*, v, validators)
     239        Validators& vals=getValidators();
     240        FOREACH(GenoValidator*, v, vals)
    237241                if ((isvalid = v->testGenoValidity(*this)) >= 0)
    238242                        return;
Note: See TracChangeset for help on using the changeset viewer.