mirror of
https://github.com/pocoproject/poco.git
synced 2025-04-27 18:30:51 +02:00
trunk/branch integration: AsyncChannel locking fix
This commit is contained in:
parent
ec76633667
commit
be689588e4
@ -86,7 +86,7 @@ AsyncChannel::~AsyncChannel()
|
|||||||
|
|
||||||
void AsyncChannel::setChannel(Channel* pChannel)
|
void AsyncChannel::setChannel(Channel* pChannel)
|
||||||
{
|
{
|
||||||
FastMutex::ScopedLock lock(_mutex);
|
FastMutex::ScopedLock lock(_channelMutex);
|
||||||
|
|
||||||
if (_pChannel) _pChannel->release();
|
if (_pChannel) _pChannel->release();
|
||||||
_pChannel = pChannel;
|
_pChannel = pChannel;
|
||||||
@ -102,7 +102,7 @@ Channel* AsyncChannel::getChannel() const
|
|||||||
|
|
||||||
void AsyncChannel::open()
|
void AsyncChannel::open()
|
||||||
{
|
{
|
||||||
FastMutex::ScopedLock lock(_mutex);
|
FastMutex::ScopedLock lock(_threadMutex);
|
||||||
|
|
||||||
if (!_thread.isRunning())
|
if (!_thread.isRunning())
|
||||||
_thread.start(*this);
|
_thread.start(*this);
|
||||||
@ -150,7 +150,7 @@ void AsyncChannel::run()
|
|||||||
{
|
{
|
||||||
MessageNotification* pNf = dynamic_cast<MessageNotification*>(nf.get());
|
MessageNotification* pNf = dynamic_cast<MessageNotification*>(nf.get());
|
||||||
{
|
{
|
||||||
FastMutex::ScopedLock lock(_mutex);
|
FastMutex::ScopedLock lock(_channelMutex);
|
||||||
|
|
||||||
if (pNf && _pChannel) _pChannel->log(pNf->message());
|
if (pNf && _pChannel) _pChannel->log(pNf->message());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user