#pragma once #include #include "sync/spinlock.hpp" #include "sync/lockable.hpp" template class SpinLockedList : Lockable { public: void push_front(T item) { auto guard = this->acquire(); head = new Node(item, head); } bool remove(const T&) { // HM! } private: struct Node : Lockable { Node(T item, Node* next) : item(item), next(next) {} T item; Node* next; }; Node* head; // TODO add removed items to a list for garbage collection // std::list removed; };