PStack
2.0
Stack trace printer for MSVC and GCC binaries
|
The basic control block for a shared_handle. More...
Public Member Functions | |
shared_handle_data () noexcept | |
Initialize a usage count of 1 and a weak-usage count of 1. | |
virtual | ~shared_handle_data () noexcept |
Provide a virtual destructor for polymorphic deletion. | |
virtual void | delete_handle (T hndl) noexcept |
Remove resources associated with a handle. More... | |
Public Attributes | |
std::atomic< size_t > | m_usage_count |
The count of shared_handle instances that are managing this handle. | |
std::atomic< size_t > | m_weak_count |
The "weak" reference count (manages the control block). More... | |
The basic control block for a shared_handle.
This is a "basic" control block because it does not support a custom deleter.
|
inlinevirtualnoexcept |
Remove resources associated with a handle.
The intention of this method is for cleaning the handle that is managed by a shared_handle instance. This is a virtual method because the derived class may use a different deleter.
[in] | hndl | The handle to close. |
std::shared_ptr
interface), I wouldn't need the control block to have a template param (or a vtable
). Reimplemented in psystem::shared_handle< T, kInvalidHandle >::shared_handle_data_with_delete< D >.
std::atomic<size_t> psystem::shared_handle< T, kInvalidHandle >::shared_handle_data::m_weak_count |
The "weak" reference count (manages the control block).
This is the count of weak_handle instances — plus 1 if there are active shared_handle instances.