logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Schöning <tschoen...@am-soft.de>
Subject Re: getRootLogger() thread-safe?
Date Mon, 10 Mar 2014 07:20:18 GMT
Guten Tag Kaspar Fischer,
am Montag, 10. März 2014 um 03:20 schrieben Sie:

> Is getRootLogger() thread safe?

Looks like the same problem as in LOGCXX-394 to me.

https://issues.apache.org/jira/browse/LOGCXX-394

> RepositorySelectorPtr& LogManager::getRepositorySelector() {
>    //
>    //     call to initialize APR and trigger "start" of logging clock
>    //
>    APRInitializer::initialize();
>    static spi::RepositorySelectorPtr selector;
>    return selector;
> }

> LoggerRepositoryPtr& LogManager::getLoggerRepository()
> {
>         if (getRepositorySelector() == 0)
>         {
>                 LoggerRepositoryPtr hierarchy(new Hierarchy());
>                 RepositorySelectorPtr selector(new DefaultRepositorySelector(hierarchy));
>                 getRepositorySelector() = selector;
>         }
>
>         return getRepositorySelector()->getLoggerRepository();
> }

> LoggerPtr LogManager::getRootLogger()
> {
>         // Delegate the actual manufacturing of the logger to the logger repository.
>         return getLoggerRepository()->getRootLogger();
> }

Could try to just remove the "static" in the following line?

>    static spi::RepositorySelectorPtr selector;

If that works, we'll consider just removing that on trunk as well,
like with LOG4CXX-394.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail:Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


Mime
View raw message