24 #ifndef _CORE_UTILS_LOCK_LIST_H_ 25 #define _CORE_UTILS_LOCK_LIST_H_ 27 #include <core/threading/mutex.h> 28 #include <core/utils/refptr.h> 43 template <
typename Type>
44 class LockList :
public std::list<Type>
61 virtual void lock()
const;
69 virtual void unlock()
const;
112 template <
typename Type>
117 template <
typename Type>
122 template <
typename Type>
129 template <
typename Type>
136 template <
typename Type>
143 template <
typename Type>
148 std::list<Type>::push_back(x);
152 template <
typename Type>
157 std::list<Type>::push_front(x);
161 template <
typename Type>
166 std::list<Type>::remove(x);
170 template <
typename Type>
177 template <
typename Type>
185 for (i = ll.begin(); i != ll.end(); ++i) {
194 template <
typename Type>
200 typename std::list<Type>::const_iterator i;
201 for (i = l.begin(); i != l.end(); ++i) {
LockList< Type > & operator=(const LockList< Type > &ll)
Copy values from another LockList.
virtual void lock() const
Lock list.
Fawkes library namespace.
void push_back_locked(const Type &x)
Push element to list at back with lock protection.
void remove_locked(const Type &x)
Remove element from list with lock protection.
RefPtr< Mutex > mutex() const
Get access to the internal mutex.
virtual bool try_lock() const
Try to lock list.
virtual void unlock() const
Unlock list.
void push_front_locked(const Type &x)
Push element to list at front with lock protection.
virtual ~LockList()
Destructor.
RefPtr<> is a reference-counting shared smartpointer.
Mutex mutual exclusion lock.