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>
112 template <
typename Type>
117 template <
typename Type>
122 template <
typename Type>
129 template <
typename Type>
133 return mutex_->try_lock();
136 template <
typename Type>
140 return mutex_->unlock();
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) {
void push_front_locked(const Type &x)
Push element to list at front with lock protection.
LockList< Type > & operator=(const LockList< Type > &ll)
Copy values from another LockList.
virtual void unlock() const
Unlock list.
void push_back_locked(const Type &x)
Push element to list at back with lock protection.
virtual void lock() const
Lock list.
RefPtr< Mutex > mutex() const
Get access to the internal mutex.
void remove_locked(const Type &x)
Remove element from list with lock protection.
virtual ~LockList()
Destructor.
virtual bool try_lock() const
Try to lock list.
LockList< Type > & operator=(const std::list< Type > &l)
Copy values from a standard list.
LockList(const LockList< Type > &ll)
Copy constructor.
Mutex mutual exclusion lock.
RefPtr<> is a reference-counting shared smartpointer.
Fawkes library namespace.