extern StatBag S;
-LockGuarded<vector<UeberBackend*>> UeberBackend::d_instances;
-
// initially we are blocked
bool UeberBackend::d_go = false;
bool UeberBackend::s_doANYLookupsOnly = false;
UeberBackend::UeberBackend(const string& pname)
{
- {
- d_instances.lock()->push_back(this); // report to the static list of ourself
- }
-
d_cache_ttl = ::arg().asNum("query-cache-ttl");
d_negcache_ttl = ::arg().asNum("negquery-cache-ttl");
UeberBackend::~UeberBackend()
{
- DLOG(g_log << Logger::Error << "UeberBackend destructor called, removing ourselves from instances, and deleting our backends" << endl);
-
- {
- auto instances = d_instances.lock();
- [[maybe_unused]] auto end = remove(instances->begin(), instances->end(), this);
- instances->resize(instances->size() - 1);
- }
+ DLOG(g_log << Logger::Error << "UeberBackend destructor called, deleting our backends" << endl);
backends.clear();
}
bool autoPrimaryRemove(const struct AutoPrimary& primary);
bool autoPrimariesList(std::vector<AutoPrimary>& primaries);
- /** Tracks all created UeberBackend instances for us. We use this vector to notify
- existing threads of new modules
- */
- static LockGuarded<vector<UeberBackend*>> d_instances;
-
static bool loadmodule(const string& name);
static bool loadModules(const vector<string>& modules, const string& path);