mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-27 02:53:10 +01:00
merge some changes from develop branch; modernize and clean-up code; remove support for compiling without POCO_WIN32_UTF8
This commit is contained in:
@@ -46,11 +46,10 @@ private:
|
||||
};
|
||||
|
||||
|
||||
AsyncChannel::AsyncChannel(Channel* pChannel, Thread::Priority prio):
|
||||
AsyncChannel::AsyncChannel(Channel::Ptr pChannel, Thread::Priority prio):
|
||||
_pChannel(pChannel),
|
||||
_thread("AsyncChannel")
|
||||
{
|
||||
if (_pChannel) _pChannel->duplicate();
|
||||
_thread.setPriority(prio);
|
||||
}
|
||||
|
||||
@@ -60,7 +59,6 @@ AsyncChannel::~AsyncChannel()
|
||||
try
|
||||
{
|
||||
close();
|
||||
if (_pChannel) _pChannel->release();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
@@ -69,17 +67,15 @@ AsyncChannel::~AsyncChannel()
|
||||
}
|
||||
|
||||
|
||||
void AsyncChannel::setChannel(Channel* pChannel)
|
||||
void AsyncChannel::setChannel(Channel::Ptr pChannel)
|
||||
{
|
||||
FastMutex::ScopedLock lock(_channelMutex);
|
||||
|
||||
if (_pChannel) _pChannel->release();
|
||||
_pChannel = pChannel;
|
||||
if (_pChannel) _pChannel->duplicate();
|
||||
}
|
||||
|
||||
|
||||
Channel* AsyncChannel::getChannel() const
|
||||
Channel::Ptr AsyncChannel::getChannel() const
|
||||
{
|
||||
return _pChannel;
|
||||
}
|
||||
@@ -89,8 +85,7 @@ void AsyncChannel::open()
|
||||
{
|
||||
FastMutex::ScopedLock lock(_threadMutex);
|
||||
|
||||
if (!_thread.isRunning())
|
||||
_thread.start(*this);
|
||||
if (!_thread.isRunning()) _thread.start(*this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user