Commit e406bdbb authored by Max Kellermann's avatar Max Kellermann

input/tidal: use class IntrusiveList

parent 1048f236
......@@ -24,8 +24,7 @@
#include "lib/curl/Init.hxx"
#include "thread/Mutex.hxx"
#include "event/DeferEvent.hxx"
#include <boost/intrusive/list.hpp>
#include "util/IntrusiveList.hxx"
#include <memory>
#include <string>
......@@ -36,7 +35,7 @@
* Its methods must be thread-safe.
*/
class TidalSessionHandler
: public boost::intrusive::list_base_hook<boost::intrusive::link_mode<boost::intrusive::safe_link>>
: public SafeLinkIntrusiveListHook
{
public:
/**
......@@ -84,8 +83,7 @@ class TidalSessionManager final : TidalLoginHandler {
*/
std::string session;
typedef boost::intrusive::list<TidalSessionHandler,
boost::intrusive::constant_time_size<false>> LoginHandlerList;
using LoginHandlerList = IntrusiveList<TidalSessionHandler>;
LoginHandlerList handlers;
......@@ -123,7 +121,7 @@ public:
void RemoveLoginHandler(TidalSessionHandler &h) noexcept {
const std::lock_guard<Mutex> protect(mutex);
if (h.is_linked())
handlers.erase(handlers.iterator_to(h));
h.unlink();
}
const char *GetToken() const noexcept {
......
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