Fix a possible thread stall resulting in processing delay or OS udp buffer overflow. (#1494)

This commit is contained in:
clemahieu 2018-12-28 18:21:29 +01:00 committed by Roy Keene
commit 34926f8322
2 changed files with 3 additions and 3 deletions

View file

@ -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 ()
{
@ -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 ()
{

View file

@ -256,9 +256,9 @@ public:
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