24 #ifndef __CORE_UTILS_RWLOCK_LIST_H_ 25 #define __CORE_UTILS_RWLOCK_LIST_H_ 27 #include <core/threading/read_write_lock.h> 28 #include <core/utils/refptr.h> 34 template <
typename Type>
72 template <
typename Type>
81 template <
typename Type>
88 template <
typename Type>
94 template <
typename Type>
98 __rwlock->lock_for_read();
103 template <
typename Type>
107 __rwlock->lock_for_write();
114 template <
typename Type>
118 return __rwlock->try_lock_for_read();
125 template <
typename Type>
129 return __rwlock->try_lock_for_write();
134 template <
typename Type>
138 return __rwlock->unlock();
145 template <
typename Type>
149 __rwlock->lock_for_write();
150 std::list<Type>::push_back(x);
158 template <
typename Type>
162 __rwlock->lock_for_write();
163 std::list<Type>::push_front(x);
171 template <
typename Type>
175 __rwlock->lock_for_write();
176 std::list<Type>::remove(x);
184 template <
typename Type>
198 template <
typename Type>
202 __rwlock->lock_for_write();
206 for (i = ll.begin(); i != ll.end(); ++i) {
222 template <
typename Type>
226 __rwlock->lock_for_write();
228 typename std::list<Type>::const_iterator i;
229 for (i = l.begin(); i != l.end(); ++i) {
RWLockList< Type > & operator=(const RWLockList< Type > &ll)
Copy values from another RWLockList.
void push_back_locked(const Type &x)
Push element to list at back with lock protection.
Fawkes library namespace.
void remove_locked(const Type &x)
Remove element from list with lock protection.
virtual bool try_lock_for_read()
Try to lock list for reading.
virtual void lock_for_read()
Lock list for reading.
virtual void unlock()
Unlock list.
Read/write lock to allow multiple readers but only a single writer on the resource at a time...
virtual void lock_for_write()
Lock list for writing.
virtual bool try_lock_for_write()
Try to lock list for writing.
RefPtr<> is a reference-counting shared smartpointer.
RefPtr< ReadWriteLock > rwlock() const
Get access to the internal read/write lock.
virtual ~RWLockList()
Destructor.
void push_front_locked(const Type &x)
Push element to list at front with lock protection.
List with a read/write lock.