Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a possible thread stall #1494

Merged
merged 2 commits into from
Dec 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rai/node/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3692,7 +3692,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 @@ -3716,7 +3716,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