mirror of
https://mirror.suhoan.cn/https://github.com/EasyTier/EasyTier.git
synced 2025-12-16 06:37:23 +08:00
fix ring buffer stuck when using multi thread runtime
This commit is contained in:
@@ -522,7 +522,7 @@ mod tests {
|
||||
tests::{connect_peer_manager, wait_route_appear},
|
||||
},
|
||||
proto::common::NatType,
|
||||
tunnel::common::tests::{enable_log, wait_for_condition},
|
||||
tunnel::common::tests::wait_for_condition,
|
||||
};
|
||||
|
||||
use super::*;
|
||||
|
||||
@@ -25,6 +25,7 @@ use zerocopy::AsBytes;
|
||||
use crate::{
|
||||
common::{
|
||||
config::{NetworkIdentity, NetworkSecretDigest},
|
||||
defer,
|
||||
error::Error,
|
||||
global_ctx::ArcGlobalCtx,
|
||||
PeerId,
|
||||
@@ -103,7 +104,9 @@ impl PeerConn {
|
||||
my_peer_id,
|
||||
global_ctx,
|
||||
|
||||
tunnel: Arc::new(Mutex::new(Box::new(mpsc_tunnel))),
|
||||
tunnel: Arc::new(Mutex::new(Box::new(defer::Defer::new(move || {
|
||||
mpsc_tunnel.close()
|
||||
})))),
|
||||
sink,
|
||||
recv: Arc::new(Mutex::new(Some(recv))),
|
||||
tunnel_info,
|
||||
|
||||
Reference in New Issue
Block a user