[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r9008 - usrp2/branches/features/host-ng/host-ng/lib
From: |
eb |
Subject: |
[Commit-gnuradio] r9008 - usrp2/branches/features/host-ng/host-ng/lib |
Date: |
Thu, 24 Jul 2008 17:41:13 -0600 (MDT) |
Author: eb
Date: 2008-07-24 17:41:12 -0600 (Thu, 24 Jul 2008)
New Revision: 9008
Modified:
usrp2/branches/features/host-ng/host-ng/lib/ring.cc
usrp2/branches/features/host-ng/host-ng/lib/ring.h
Log:
pretty sure I fixed the hang
Modified: usrp2/branches/features/host-ng/host-ng/lib/ring.cc
===================================================================
--- usrp2/branches/features/host-ng/host-ng/lib/ring.cc 2008-07-24 22:53:51 UTC
(rev 9007)
+++ usrp2/branches/features/host-ng/host-ng/lib/ring.cc 2008-07-24 23:41:12 UTC
(rev 9008)
@@ -48,6 +48,7 @@
bool
ring::enqueue(void *p, size_t len)
{
+ omni_mutex_lock l(d_mutex);
if (full())
return false;
@@ -62,6 +63,7 @@
bool
ring::dequeue(void **p, size_t *len)
{
+ omni_mutex_lock l(d_mutex);
if (empty())
return false;
Modified: usrp2/branches/features/host-ng/host-ng/lib/ring.h
===================================================================
--- usrp2/branches/features/host-ng/host-ng/lib/ring.h 2008-07-24 22:53:51 UTC
(rev 9007)
+++ usrp2/branches/features/host-ng/host-ng/lib/ring.h 2008-07-24 23:41:12 UTC
(rev 9008)
@@ -61,13 +61,13 @@
d_write_ind = d_write_ind + 1;
}
+ bool empty() const { return d_read_ind == d_write_ind; }
+ bool full() const { return (d_write_ind+1)%d_max == d_read_ind; }
+
public:
ring(unsigned int entries);
- bool empty() const { return d_read_ind == d_write_ind; }
- bool full() const { return (d_write_ind+1)%d_max == d_read_ind; }
-
void wait_for_not_empty();
bool enqueue(void *p, size_t len);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r9008 - usrp2/branches/features/host-ng/host-ng/lib,
eb <=