pub struct ThreadExtensionLease { /* private fields */ }Expand description
Owned extension lease used when the caller has no pre-existing handle.
Keeping this value alive pins both the thread header and the registry record, so current-thread helpers cannot return data that becomes stale immediately after their temporary lookup handle is dropped.
Implementations§
Source§impl ThreadExtensionLease
impl ThreadExtensionLease
Sourcepub fn thread_id(&self) -> ThreadId
pub fn thread_id(&self) -> ThreadId
Returns the generation-bearing identity pinned by this lease.
Sourcepub const fn ops(&self) -> &'static ThreadExtensionOps
pub const fn ops(&self) -> &'static ThreadExtensionOps
Returns the callback table used as the extension type identity.
Sourcepub unsafe fn release_for_current_thread_entry(self) -> ThreadExtensionView
pub unsafe fn release_for_current_thread_entry(self) -> ThreadExtensionView
Releases the strong lookup lease while retaining the extension view.
Fresh thread-entry trampolines need this operation before invoking an entry point that terminates through a non-unwinding scheduler switch. Otherwise the suspended stack permanently pins the exited thread.
§Safety
The caller must be the running thread identified by Self::thread_id.
Its registry record must remain live until every use of the returned
view completes. The consumed lookup lease and its pinned thread header
must not be accessed again, and the returned view must not escape past
thread exit.