[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 83/148: added timeout to ring wait calls
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 83/148: added timeout to ring wait calls |
Date: |
Mon, 15 Aug 2016 00:47:27 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
nwest pushed a commit to annotated tag old_usrp_devel_udp
in repository gnuradio.
commit 5e1e2339274b087b2064271cd92256d01db962d0
Author: Josh Blum <address@hidden>
Date: Tue Dec 15 18:31:29 2009 -0800
added timeout to ring wait calls
---
usrp2/host/lib/eth_data_transport.cc | 4 ++--
usrp2/host/lib/ring.cc | 8 ++++----
usrp2/host/lib/ring.h | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/usrp2/host/lib/eth_data_transport.cc
b/usrp2/host/lib/eth_data_transport.cc
index e8928d9..628c6ae 100644
--- a/usrp2/host/lib/eth_data_transport.cc
+++ b/usrp2/host/lib/eth_data_transport.cc
@@ -101,7 +101,7 @@ void usrp2::eth_data_transport::recv_bg(void){
d_eth_data->release_frame(rd.base);
}
}
- d_ring->wait_for_empty();
+ d_ring->wait_for_empty(gruel::get_new_timeout(0.1)); //magic timeout in sec
}
void usrp2::eth_data_transport::recv_loop(){
@@ -145,7 +145,7 @@ bool usrp2::eth_data_transport::sendv(const iovec *iov,
size_t iovlen){
}
void usrp2::eth_data_transport::recv(data_handler *handler){
- d_ring->wait_for_not_empty();
+ d_ring->wait_for_not_empty(gruel::get_new_timeout(0.1)); //magic timeout
in sec
while (true){
ring_data rd;
DEBUG_LOG("-");
diff --git a/usrp2/host/lib/ring.cc b/usrp2/host/lib/ring.cc
index 9765497..286caa2 100644
--- a/usrp2/host/lib/ring.cc
+++ b/usrp2/host/lib/ring.cc
@@ -34,19 +34,19 @@ namespace usrp2 {
{/*NOP*/}
void
- ring::wait_for_empty()
+ ring::wait_for_empty(boost::system_time timeout)
{
gruel::scoped_lock l(d_mutex);
while (not empty())
- d_empty_cond.wait(l);
+ d_empty_cond.timed_wait(l, timeout);
}
void
- ring::wait_for_not_empty()
+ ring::wait_for_not_empty(boost::system_time timeout)
{
gruel::scoped_lock l(d_mutex);
while (empty())
- d_not_empty_cond.wait(l);
+ d_not_empty_cond.timed_wait(l, timeout);
}
bool
diff --git a/usrp2/host/lib/ring.h b/usrp2/host/lib/ring.h
index 8672f82..2a91dcc 100644
--- a/usrp2/host/lib/ring.h
+++ b/usrp2/host/lib/ring.h
@@ -76,8 +76,8 @@ namespace usrp2 {
ring(unsigned int entries);
- void wait_for_empty();
- void wait_for_not_empty();
+ void wait_for_empty(boost::system_time timeout);
+ void wait_for_not_empty(boost::system_time timeout);
bool enqueue(const ring_data &rd);
bool dequeue(ring_data &rd);
- [Commit-gnuradio] [gnuradio] 86/148: Removed the channel ring from the eth transport. Made the eth transport a data handler to pass directly to the eth buffer, and to strip ethernet headers/transport information., (continued)
- [Commit-gnuradio] [gnuradio] 86/148: Removed the channel ring from the eth transport. Made the eth transport a data handler to pass directly to the eth buffer, and to strip ethernet headers/transport information., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 58/148: Merge branch 'vita_rx' of http://gnuradio.org/git/matt into wip/usrp2, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 56/148: ignore save files, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 73/148: Merge branch 'vita_rx' of http://gnuradio.org/git/matt into wip/usrp2, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 61/148: Merge branch 'vita_rx' of gnuradio.org:matt into vita_rx, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 59/148: WIP host mods to send vrt packets, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 76/148: Merge branch 'master' of http://gnuradio.org/git/gnuradio into vita_rx, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 64/148: put new setting reg into the address space in the right place, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 74/148: Merge branch 'wip/usrp2' of address@hidden:jblum into wip/usrp2, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 78/148: Merge branch 'vita_rx' of gnuradio.org:matt into vita_rx, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 83/148: added timeout to ring wait calls,
git <=
- [Commit-gnuradio] [gnuradio] 60/148: fixed typo in u2_core.v resulting in unconnected net. added debug pins, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 99/148: removed unused copy handler, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 95/148: added documentation for handling of the expanded headers in the transmit calls, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 92/148: Added unparse capability to the vrt expanded header. Unparse can fill in a vrt header and trailer from an expanded header., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 89/148: Replaced tx metadata with vrt expanded header., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 75/148: dsp_core_tx now has setting reg base settable from u2_core. underrun bug in vrt fixed, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 98/148: usrp2 impl finds out max frame size from the transport, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 96/148: Merge branch 'vrt' of address@hidden:jblum into wip/usrp2, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 128/148: yet more debug lines, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 118/148: more typo fixes., git, 2016/08/14