24 #ifndef _CORE_UTILS_RWLOCK_QUEUE_H_
25 #define _CORE_UTILS_RWLOCK_QUEUE_H_
27 #include <core/threading/read_write_lock.h>
28 #include <core/utils/refptr.h>
34 template <
typename Type>
71 template <
typename Type>
80 template <
typename Type>
87 template <
typename Type>
94 template <
typename Type>
98 rwlock_->lock_for_read();
102 template <
typename Type>
106 rwlock_->lock_for_write();
112 template <
typename Type>
116 return rwlock_->try_lock_for_read();
122 template <
typename Type>
126 return rwlock_->try_lock_for_write();
130 template <
typename Type>
134 return rwlock_->unlock();
140 template <
typename Type>
144 rwlock_->lock_for_write();
145 std::queue<Type>::push(x);
151 template <
typename Type>
155 rwlock_->lock_for_write();
156 std::queue<Type>::pop();
161 template <
typename Type>
165 rwlock_->lock_for_write();
166 while (!std::queue<Type>::empty()) {
167 std::queue<Type>::pop();
176 template <
typename Type>