Boost logo

Boost :

Subject: Re: [boost] Boost.log: set_channel name dynamically for a basic_composite_logger
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2012-10-16 13:26:42


On Tue, Oct 16, 2012 at 12:48 AM, syvyi <alexander.svk_at_[hidden]> wrote:
> manster_logging_test.rar
> <http://boost.2283326.n4.nabble.com/file/n4637182/manster_logging_test.rar>
> Andrey, I am using v.1.1 in code attached in file. It is a test of 2 files.
> Please, take a look at those files, tell if you succeed to compile them.
> This is the same code as above but without adapter, which worked.
>
> Info:
>
> after tracing I get
>
>
> Here is the problem, WatForSingleObject is called and after one BOOST_LOG
> macros app. is frozen.

The problem is because you keep a locked_backend_ptr within the
logger. While this pointer exists the sink backend is locked and thus
you deadlock when you try to log. This pointer should only be kept for
the scope where you setup the sink.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk