dns lazy init. concern about thread-safety

This commit is contained in:
zephyr
2024-02-22 01:26:54 +09:00
parent 999a61d1fc
commit 6a3bcdddc9
+4
View File
@@ -10,8 +10,12 @@ use resolver::lookup_ip::{LookupIp, LookupIpIter};
pub use resolver::config;
use config::{ResolverOpts, ResolverConfig};
#[cfg(not(feature = "multi-thread"))]
use once_cell::unsync::{OnceCell, Lazy};
#[cfg(feature = "multi-thread")]
use once_cell::{unsync::OnceCell, sync::Lazy};
use crate::endpoint::RemoteAddr;
/// Dns config.