merged alert fix from libtorrent_aio
This commit is contained in:
parent
52b205e6cb
commit
58d5b9aedc
|
@ -408,13 +408,8 @@ namespace libtorrent {
|
||||||
void alert_manager::post_alert_ptr(alert* alert_)
|
void alert_manager::post_alert_ptr(alert* alert_)
|
||||||
{
|
{
|
||||||
std::auto_ptr<alert> a(alert_);
|
std::auto_ptr<alert> a(alert_);
|
||||||
mutex::scoped_lock lock(m_mutex);
|
|
||||||
|
|
||||||
post_impl(a);
|
|
||||||
|
|
||||||
#ifndef TORRENT_DISABLE_EXTENSIONS
|
#ifndef TORRENT_DISABLE_EXTENSIONS
|
||||||
lock.unlock();
|
|
||||||
|
|
||||||
for (ses_extension_list_t::iterator i = m_ses_extensions.begin()
|
for (ses_extension_list_t::iterator i = m_ses_extensions.begin()
|
||||||
, end(m_ses_extensions.end()); i != end; ++i)
|
, end(m_ses_extensions.end()); i != end; ++i)
|
||||||
{
|
{
|
||||||
|
@ -424,18 +419,15 @@ namespace libtorrent {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
mutex::scoped_lock lock(m_mutex);
|
||||||
|
post_impl(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
void alert_manager::post_alert(const alert& alert_)
|
void alert_manager::post_alert(const alert& alert_)
|
||||||
{
|
{
|
||||||
std::auto_ptr<alert> a(alert_.clone());
|
std::auto_ptr<alert> a(alert_.clone());
|
||||||
mutex::scoped_lock lock(m_mutex);
|
|
||||||
|
|
||||||
post_impl(a);
|
|
||||||
|
|
||||||
#ifndef TORRENT_DISABLE_EXTENSIONS
|
#ifndef TORRENT_DISABLE_EXTENSIONS
|
||||||
lock.unlock();
|
|
||||||
|
|
||||||
for (ses_extension_list_t::iterator i = m_ses_extensions.begin()
|
for (ses_extension_list_t::iterator i = m_ses_extensions.begin()
|
||||||
, end(m_ses_extensions.end()); i != end; ++i)
|
, end(m_ses_extensions.end()); i != end; ++i)
|
||||||
{
|
{
|
||||||
|
@ -445,6 +437,8 @@ namespace libtorrent {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
mutex::scoped_lock lock(m_mutex);
|
||||||
|
post_impl(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
void alert_manager::post_impl(std::auto_ptr<alert>& alert_)
|
void alert_manager::post_impl(std::auto_ptr<alert>& alert_)
|
||||||
|
|
Loading…
Reference in New Issue