[controller] fix input delay when there are a lot data to read.

the problem is that the controller will save all items read before send the
NewItem event to matcher. Meanwhile the matcher keeps going because no signal
is received. And since the controller will need to lock the data of items and
that lock is not released by matcher. Kind of deadlock here.
This commit is contained in:
Mark Wallace 2016-06-26 09:21:36 +08:00
parent 2713175ec0
commit fc6882e826

View file

@ -67,11 +67,11 @@ fn main() {
for (e, val) in eb.wait() {
match e {
Event::EvReaderNewItem | Event::EvReaderFinished => {
eb_matcher.set(Event::EvMatcherNewItem, Box::new(true));
let mut items = model.items.write().unwrap();
while let Ok(string) = rx_source.try_recv() {
items.push(string);
}
eb_matcher.set(Event::EvMatcherNewItem, Box::new(true));
}
Event::EvMatcherUpdateProcess => {