Skip to content

Commit

Permalink
Just don't ask. We'll fix this right if this is the issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelKatz authored and vinniefalco committed May 3, 2013
1 parent 906a179 commit 8fdf1ec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/messages/data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ template <class element_type>
element_ptr get() {
boost::lock_guard<boost::recursive_mutex> lock(m_lock);

element_ptr p;
element_ptr p, q;

/*std::cout << "message requested ("
<< m_cur_elements-m_avaliable.size()
Expand All @@ -95,7 +95,8 @@ template <class element_type>

if (!m_avaliable.empty()) {
p = m_avaliable.front();
m_avaliable.pop();
q = p;
m_avaliable.pop(); // FIXME can call intrusive_ptr_release(line 217) which can deadlock
m_used[p->get_index()] = p;
} else {
if (m_cur_elements == m_max_elements) {
Expand Down Expand Up @@ -210,6 +211,7 @@ class data {
typedef websocketpp::processor::hybi_util::masking_key_type masking_key_type;

friend void intrusive_ptr_add_ref(const data * s) {
boost::unique_lock<boost::mutex> lock(s->m_lock);
++s->m_ref_count;
}

Expand Down

0 comments on commit 8fdf1ec

Please sign in to comment.