From 0bf2128a621ae84099f43744e1b81800f2b9d2d7 Mon Sep 17 00:00:00 2001 From: eb Date: Wed, 2 May 2007 04:08:47 +0000 Subject: Merged features/inband -r4812:5218 into trunk. This group of changes includes: * working stand-alone mblock code * work-in-progress on usrp inband signaling usrp now depends on mblock, and guile is a dependency. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@5221 221aa14e-8319-0410-a670-987f0aec2ac5 --- mblock/src/lib/mb_msg_queue.cc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'mblock/src/lib/mb_msg_queue.cc') diff --git a/mblock/src/lib/mb_msg_queue.cc b/mblock/src/lib/mb_msg_queue.cc index 79e245ad6..c687e8760 100644 --- a/mblock/src/lib/mb_msg_queue.cc +++ b/mblock/src/lib/mb_msg_queue.cc @@ -83,7 +83,7 @@ mb_msg_queue::get_highest_pri_msg_helper() } } - return mb_message_sptr(); // equivalent of a zero pointer + return mb_message_sptr(); // eqv to a zero pointer } @@ -109,3 +109,20 @@ mb_msg_queue::get_highest_pri_msg() } } +mb_message_sptr +mb_msg_queue::get_highest_pri_msg_timedwait(const mb_time &abs_time) +{ + unsigned long secs = abs_time.d_secs; + unsigned long nsecs = abs_time.d_nsecs; + + omni_mutex_lock l(d_mutex); + + while (1){ + mb_message_sptr msg = get_highest_pri_msg_helper(); + if (msg) // Got one; return it + return msg; + + if (!d_not_empty.timedwait(secs, nsecs)) // timed out + return mb_message_sptr(); // eqv to zero pointer + } +} -- cgit