diff options
author | trociny <trociny@FreeBSD.org> | 2013-09-19 20:15:24 +0000 |
---|---|---|
committer | trociny <trociny@FreeBSD.org> | 2013-09-19 20:15:24 +0000 |
commit | 2604d523b6631d11bcc72412ec3d3c2fd27dffc9 (patch) | |
tree | 59bea261baea2bce02ac05f712aa4647dfd2b99a /sbin/nos-tun | |
parent | a54f6a964507b7e14c57243c46abf6e66752282e (diff) | |
download | FreeBSD-src-2604d523b6631d11bcc72412ec3d3c2fd27dffc9.zip FreeBSD-src-2604d523b6631d11bcc72412ec3d3c2fd27dffc9.tar.gz |
Use cv_broadcast() instead of cv_signal() when waking up threads
waiting on an empty queue as the queue may have several consumers.
Before the fix the following scenario was possible: 2 threads are
waiting on empty queue, 2 threads are inserting simultaneously. The
first inserting thread detects that the queue is empty and is going to
send the signal, but before it sends the second thread inserts
too. When the first sends the signal only one of the waiting threads
receive it while the other one may wait forever.
The scenario above is is believed to be the cause of the observed
cases, when ggate_recv_thread() was getting stuck on taking free
request, while the free queue was not empty.
Reviewed by: pjd
Tested by: Yamagi Burmeister yamagi.org
Approved by: re (marius)
MFC after: 2 weeks
Diffstat (limited to 'sbin/nos-tun')
0 files changed, 0 insertions, 0 deletions