Hoist read lock
This commit is contained in:
@ -43,7 +43,10 @@ fn broadcast(
|
|||||||
let blobs_chunked = blobs_vec.chunks(WINDOW_SIZE as usize).map(|x| x.to_vec());
|
let blobs_chunked = blobs_vec.chunks(WINDOW_SIZE as usize).map(|x| x.to_vec());
|
||||||
|
|
||||||
if log_enabled!(Level::Trace) {
|
if log_enabled!(Level::Trace) {
|
||||||
trace!("{}", window::print_window(&id, window, *receive_index));
|
trace!(
|
||||||
|
"{}",
|
||||||
|
window::print_window(&id, &window.read().unwrap(), *receive_index)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
for mut blobs in blobs_chunked {
|
for mut blobs in blobs_chunked {
|
||||||
|
@ -465,7 +465,7 @@ fn recv_window(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
if log_enabled!(Level::Trace) {
|
if log_enabled!(Level::Trace) {
|
||||||
trace!("{}", print_window(id, window, *consumed));
|
trace!("{}", print_window(id, &window.read().unwrap(), *consumed));
|
||||||
trace!(
|
trace!(
|
||||||
"{}: consumed: {} received: {} sending consume.len: {} pixs: {:?} took {} ms",
|
"{}: consumed: {} received: {} sending consume.len: {} pixs: {:?} took {} ms",
|
||||||
id,
|
id,
|
||||||
@ -483,10 +483,8 @@ fn recv_window(
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn print_window(id: &Pubkey, window: &SharedWindow, consumed: u64) -> String {
|
pub fn print_window(id: &Pubkey, window: &Window, consumed: u64) -> String {
|
||||||
let pointer: Vec<_> = window
|
let pointer: Vec<_> = window
|
||||||
.read()
|
|
||||||
.unwrap()
|
|
||||||
.iter()
|
.iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.map(|(i, _v)| {
|
.map(|(i, _v)| {
|
||||||
@ -499,8 +497,6 @@ pub fn print_window(id: &Pubkey, window: &SharedWindow, consumed: u64) -> String
|
|||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let buf: Vec<_> = window
|
let buf: Vec<_> = window
|
||||||
.read()
|
|
||||||
.unwrap()
|
|
||||||
.iter()
|
.iter()
|
||||||
.map(|v| {
|
.map(|v| {
|
||||||
if v.data.is_none() && v.coding.is_none() {
|
if v.data.is_none() && v.coding.is_none() {
|
||||||
|
Reference in New Issue
Block a user