Skip to content

Commit

Permalink
Fix a possible thread stall resulting in processing delay or OS udp b…
Browse files Browse the repository at this point in the history
…uffer overflow. (#1494)
  • Loading branch information
clemahieu authored and rkeene committed Dec 28, 2018
1 parent 074ba48 commit 34926f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions rai/node/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3699,7 +3699,7 @@ void rai::udp_buffer::enqueue (rai::udp_data * data_a)
std::lock_guard<std::mutex> lock (mutex);
full.push_back (data_a);
}
condition.notify_one ();
condition.notify_all ();
}
rai::udp_data * rai::udp_buffer::dequeue ()
{
Expand All @@ -3723,7 +3723,7 @@ void rai::udp_buffer::release (rai::udp_data * data_a)
std::lock_guard<std::mutex> lock (mutex);
free.push_back (data_a);
}
condition.notify_one ();
condition.notify_all ();
}
void rai::udp_buffer::stop ()
{
Expand Down
2 changes: 1 addition & 1 deletion rai/node/node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ class udp_data
class udp_buffer
{
public:
// Stats - Statistics
// Size - Size of each individual buffer
// Count - Number of buffers to allocate
// Stats - Statistics
udp_buffer (rai::stat & stats, size_t, size_t);
// Return a buffer where UDP data can be put
// Method will attempt to return the first free buffer
Expand Down

0 comments on commit 34926f8

Please sign in to comment.