summaryrefslogtreecommitdiff
path: root/mblock/src/lib/mb_msg_queue.cc
diff options
context:
space:
mode:
authoreb2007-05-02 04:08:47 +0000
committereb2007-05-02 04:08:47 +0000
commit0bf2128a621ae84099f43744e1b81800f2b9d2d7 (patch)
tree1345b44ae9060e99ff236f983dd272c6d35a012e /mblock/src/lib/mb_msg_queue.cc
parent28259329a829f157fd877a1c14139eaf0117dabd (diff)
downloadgnuradio-0bf2128a621ae84099f43744e1b81800f2b9d2d7.tar.gz
gnuradio-0bf2128a621ae84099f43744e1b81800f2b9d2d7.tar.bz2
gnuradio-0bf2128a621ae84099f43744e1b81800f2b9d2d7.zip
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
Diffstat (limited to 'mblock/src/lib/mb_msg_queue.cc')
-rw-r--r--mblock/src/lib/mb_msg_queue.cc19
1 files changed, 18 insertions, 1 deletions
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
+ }
+}