Commit 5ebe23e4 authored by Max Kellermann's avatar Max Kellermann

db/upnp/Discovery: use class IntrusiveList

parent aa227cde
...@@ -49,8 +49,8 @@ void ...@@ -49,8 +49,8 @@ void
UPnPDeviceDirectory::Downloader::Destroy() noexcept UPnPDeviceDirectory::Downloader::Destroy() noexcept
{ {
const std::lock_guard<Mutex> protect(parent.mutex); const std::lock_guard<Mutex> protect(parent.mutex);
parent.downloaders.erase_and_dispose(parent.downloaders.iterator_to(*this), unlink();
DeleteDisposer()); delete this;
} }
void void
......
...@@ -28,8 +28,7 @@ ...@@ -28,8 +28,7 @@
#include "lib/curl/Request.hxx" #include "lib/curl/Request.hxx"
#include "thread/Mutex.hxx" #include "thread/Mutex.hxx"
#include "event/DeferEvent.hxx" #include "event/DeferEvent.hxx"
#include "util/IntrusiveList.hxx"
#include <boost/intrusive/list.hpp>
#include <list> #include <list>
#include <vector> #include <vector>
...@@ -80,9 +79,8 @@ class UPnPDeviceDirectory final : UpnpCallback { ...@@ -80,9 +79,8 @@ class UPnPDeviceDirectory final : UpnpCallback {
}; };
class Downloader final class Downloader final
: public boost::intrusive::list_base_hook<boost::intrusive::link_mode<boost::intrusive::normal_link>>, : public IntrusiveListHook, CurlResponseHandler
CurlResponseHandler { {
DeferEvent defer_start_event; DeferEvent defer_start_event;
UPnPDeviceDirectory &parent; UPnPDeviceDirectory &parent;
...@@ -132,8 +130,7 @@ class UPnPDeviceDirectory final : UpnpCallback { ...@@ -132,8 +130,7 @@ class UPnPDeviceDirectory final : UpnpCallback {
/** /**
* Protected by #mutex. * Protected by #mutex.
*/ */
boost::intrusive::list<Downloader, IntrusiveList<Downloader> downloaders;
boost::intrusive::constant_time_size<false>> downloaders;
/** /**
* Protected by #mutex. * Protected by #mutex.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment