Use a separate interface for loggers.
The new interface does not allow loggers to unregister themselves from the bus. This allows us to use a rwlock_t for them. The latter also means that loggers can now be called concurrently by multiple threads.
This commit is contained in:
@@ -64,7 +64,7 @@ METHOD(plugin_t, destroy, void,
|
||||
{
|
||||
charon->backends->remove_backend(charon->backends, &this->config->backend);
|
||||
lib->credmgr->remove_set(lib->credmgr, &this->cred->set);
|
||||
charon->bus->remove_listener(charon->bus, &this->logger->listener);
|
||||
charon->bus->remove_logger(charon->bus, &this->logger->logger);
|
||||
this->config->destroy(this->config);
|
||||
this->cred->destroy(this->cred);
|
||||
this->logger->destroy(this->logger);
|
||||
@@ -110,7 +110,7 @@ plugin_t *sql_plugin_create()
|
||||
|
||||
charon->backends->add_backend(charon->backends, &this->config->backend);
|
||||
lib->credmgr->add_set(lib->credmgr, &this->cred->set);
|
||||
charon->bus->add_listener(charon->bus, &this->logger->listener);
|
||||
charon->bus->add_logger(charon->bus, &this->logger->logger);
|
||||
|
||||
return &this->public.plugin;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user