File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ template <class element_type>
84
84
element_ptr get () {
85
85
boost::lock_guard<boost::recursive_mutex> lock (m_lock);
86
86
87
- element_ptr p;
87
+ element_ptr p, q ;
88
88
89
89
/* std::cout << "message requested ("
90
90
<< m_cur_elements-m_avaliable.size()
@@ -95,7 +95,8 @@ template <class element_type>
95
95
96
96
if (!m_avaliable.empty ()) {
97
97
p = m_avaliable.front ();
98
- m_avaliable.pop ();
98
+ q = p;
99
+ m_avaliable.pop (); // FIXME can call intrusive_ptr_release(line 217) which can deadlock
99
100
m_used[p->get_index ()] = p;
100
101
} else {
101
102
if (m_cur_elements == m_max_elements) {
@@ -210,6 +211,7 @@ class data {
210
211
typedef websocketpp::processor::hybi_util::masking_key_type masking_key_type;
211
212
212
213
friend void intrusive_ptr_add_ref (const data * s) {
214
+ boost::unique_lock<boost::mutex> lock (s->m_lock );
213
215
++s->m_ref_count ;
214
216
}
215
217
You can’t perform that action at this time.
0 commit comments