This commit is contained in:
Anatoly Yakovenko
2018-05-30 11:54:53 -07:00
committed by Greg Fitzgerald
parent 46059a37eb
commit f5eedd2d19
6 changed files with 58 additions and 30 deletions

View File

@@ -29,7 +29,8 @@ fn recv_loop(
let msgs = re.allocate();
let msgs_ = msgs.clone();
loop {
match msgs.write()
match msgs
.write()
.expect("write lock in fn recv_loop")
.recv_from(sock)
{
@@ -200,7 +201,8 @@ fn recv_window(
) -> Result<()> {
let timer = Duration::from_millis(200);
let mut dq = r.recv_timeout(timer)?;
let leader_id = crdt.read()
let leader_id = crdt
.read()
.expect("'crdt' read lock in fn recv_window")
.leader_data()
.id;
@@ -596,8 +598,8 @@ mod test {
use std::sync::mpsc::channel;
use std::sync::{Arc, RwLock};
use std::time::Duration;
use streamer::{default_window, BlobReceiver, PacketReceiver};
use streamer::{blob_receiver, receiver, responder, window};
use streamer::{default_window, BlobReceiver, PacketReceiver};
fn get_msgs(r: PacketReceiver, num: &mut usize) {
for _t in 0..5 {