Package io.netty5.buffer.api
Interface Owned<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
transferOwnership(Drop<T> drop)
Transfer the ownership of the resource, to the calling thread.
-
-
-
Method Detail
-
transferOwnership
T transferOwnership(Drop<T> drop)
Transfer the ownership of the resource, to the calling thread. The resource instance is invalidated but without disposing of its internal state. Then a new resource instance with the given owner is produced in its stead.This method is called by
Send
implementations. These implementations will ensure that the transfer of ownership (the calling of this method) happens-before the new owner begins accessing the new object. This ensures that the new resource instance is safely published to the new owners.- Parameters:
drop
- The drop object that knows how to dispose of the state represented by thisResource
.- Returns:
- A new resource instance that is exactly the same as this resource.
-
-