mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-26 02:43:24 +00:00
Create backlog sockets on demand
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
a739848464
commit
776fd6a892
@ -138,9 +138,22 @@ impl<T: ?Sized> KeyableArc<T> {
|
||||
}
|
||||
|
||||
/// Creates a new `KeyableWeak` pointer to this allocation.
|
||||
#[inline]
|
||||
pub fn downgrade(this: &Self) -> KeyableWeak<T> {
|
||||
Arc::downgrade(&this.0).into()
|
||||
}
|
||||
|
||||
/// Gets the number of strong pointers pointing to this allocation.
|
||||
#[inline]
|
||||
pub fn strong_count(this: &Self) -> usize {
|
||||
Arc::strong_count(&this.0)
|
||||
}
|
||||
|
||||
/// Gets the number of weak pointers pointing to this allocation.
|
||||
#[inline]
|
||||
pub fn weak_count(this: &Self) -> usize {
|
||||
Arc::weak_count(&this.0)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: ?Sized> Deref for KeyableArc<T> {
|
||||
|
Reference in New Issue
Block a user