+ // STL map are not guaranteed to be thread safe even
+ // for read-access so we need this two helpers to access them.
+ EndgameEvaluationFunction* getEEF(Key key) {
+
+ EndgameEvaluationFunction* f = NULL;
+
+ lock_grab(&EEFmapLock);
+
+ std::map<Key, EndgameEvaluationFunction*>::iterator it(EEFmap.find(key));
+ if (it != EEFmap.end())
+ f = it->second;
+
+ lock_release(&EEFmapLock);
+ return f;
+ }
+
+ ScalingInfo getESF(Key key) {
+
+ ScalingInfo si = {WHITE, NULL};
+
+ lock_grab(&ESFmapLock);
+
+ std::map<Key, ScalingInfo>::iterator it(ESFmap.find(key));
+ if (it != ESFmap.end())
+ si = it->second;
+
+ lock_release(&ESFmapLock);
+ return si;
+ }
+