summaryrefslogtreecommitdiff
path: root/gnuradio-core/src
diff options
context:
space:
mode:
authorTom Rondeau2012-02-04 11:03:40 -0500
committerTom Rondeau2012-02-13 14:56:39 -0500
commit3a21ccb8cdef50daa52f5d26293df3a03c821c99 (patch)
treebfd6b2691c1a2992de2b5f7d94e44b0edaa61810 /gnuradio-core/src
parentae663decab658be25ac01072fa2f5c8454bd6167 (diff)
downloadgnuradio-3a21ccb8cdef50daa52f5d26293df3a03c821c99.tar.gz
gnuradio-3a21ccb8cdef50daa52f5d26293df3a03c821c99.tar.bz2
gnuradio-3a21ccb8cdef50daa52f5d26293df3a03c821c99.zip
sched: some added protections and checks for the alignment states.
Diffstat (limited to 'gnuradio-core/src')
-rw-r--r--gnuradio-core/src/lib/runtime/gr_block_executor.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/gnuradio-core/src/lib/runtime/gr_block_executor.cc b/gnuradio-core/src/lib/runtime/gr_block_executor.cc
index 11c6639b3..86289695a 100644
--- a/gnuradio-core/src/lib/runtime/gr_block_executor.cc
+++ b/gnuradio-core/src/lib/runtime/gr_block_executor.cc
@@ -183,7 +183,8 @@ gr_block_executor::run_one_iteration()
int noutput_items;
int max_items_avail;
int max_noutput_items = d_max_noutput_items;
- int new_alignment;
+ int new_alignment=0;
+ int alignment_state=-1;
gr_block *m = d_block.get();
gr_block_detail *d = m->detail().get();
@@ -338,6 +339,7 @@ gr_block_executor::run_one_iteration()
else {
new_alignment = m->unaligned() - noutput_items;
}
+ alignment_state = 0;
}
else if(noutput_items < m->alignment()) {
// if we don't have enough for an aligned call, keep track of
@@ -345,11 +347,13 @@ gr_block_executor::run_one_iteration()
new_alignment = m->alignment() - noutput_items;
m->set_unaligned(new_alignment);
m->set_is_unaligned(true);
+ alignment_state = 1;
}
else {
// enough to round down to the nearest alignment and process.
noutput_items = round_down(noutput_items, m->alignment());
m->set_is_unaligned(false);
+ alignment_state = 2;
}
}
@@ -391,6 +395,12 @@ gr_block_executor::run_one_iteration()
goto were_done;
}
+ // If we were made unaligned in this round but return here without
+ // processing; reset the unalignment claim before next entry.
+ if(alignment_state == 1) {
+ m->set_unaligned(0);
+ m->set_is_unaligned(false);
+ }
return BLKD_IN;
}