Avoid holding a read lock during IO
This commit is contained in:
@ -598,8 +598,8 @@ impl ClusterInfo {
|
|||||||
/// # Remarks
|
/// # Remarks
|
||||||
/// We need to avoid having obj locked while doing any io, such as the `send_to`
|
/// We need to avoid having obj locked while doing any io, such as the `send_to`
|
||||||
pub fn retransmit(obj: &Arc<RwLock<Self>>, blob: &SharedBlob, s: &UdpSocket) -> Result<()> {
|
pub fn retransmit(obj: &Arc<RwLock<Self>>, blob: &SharedBlob, s: &UdpSocket) -> Result<()> {
|
||||||
let me = obj.read().unwrap();
|
let peers = obj.read().unwrap().retransmit_peers();
|
||||||
ClusterInfo::retransmit_to(obj, &me.retransmit_peers(), blob, s)
|
ClusterInfo::retransmit_to(obj, &peers, blob, s)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn send_orders(
|
fn send_orders(
|
||||||
|
Reference in New Issue
Block a user