MySQL 26.10.0
Source Code Documentation
mysql::system_info::internal::macOS_thread_resources Class Reference

Own native thread ports and the Mach allocated thread array. More...

#include <system_info_macos.h>

Public Member Functions

 macOS_thread_resources (thread_act_array_t threads, mach_msg_type_number_t thread_count, macOS_thread_deallocator deallocator)
 Take ownership of the thread ports and array returned by task_threads(). More...
 
 macOS_thread_resources (const macOS_thread_resources &)=delete
 
macOS_thread_resources & operator= (const macOS_thread_resources &)=delete
 
 ~macOS_thread_resources ()
 Release owned Mach resources if the collector has not released them. More...
 
std::error_code release ()
 Release every owned right and the thread array exactly once. More...
 

Private Attributes

thread_act_array_t m_threads
 
mach_msg_type_number_t m_thread_count
 
macOS_thread_deallocator m_deallocator
 
bool m_released {false}
 
std::error_code m_release_error
 

Detailed Description

Own native thread ports and the Mach allocated thread array.

Constructor & Destructor Documentation

◆ macOS_thread_resources() [1/2]

mysql::system_info::internal::macOS_thread_resources::macOS_thread_resources ( thread_act_array_t  threads,
mach_msg_type_number_t  thread_count,
macOS_thread_deallocator  deallocator 
)

Take ownership of the thread ports and array returned by task_threads().

◆ macOS_thread_resources() [2/2]

mysql::system_info::internal::macOS_thread_resources::macOS_thread_resources ( const macOS_thread_resources &  )
delete

◆ ~macOS_thread_resources()

mysql::system_info::internal::macOS_thread_resources::~macOS_thread_resources ( )

Release owned Mach resources if the collector has not released them.

Member Function Documentation

◆ operator=()

macOS_thread_resources & mysql::system_info::internal::macOS_thread_resources::operator= ( const macOS_thread_resources &  )
delete

◆ release()

std::error_code mysql::system_info::internal::macOS_thread_resources::release ( )

Release every owned right and the thread array exactly once.

Release the thread ports and allocated array returned by task_threads().

Each thread port is a 'send right' owned by the caller. The array itself is memory allocated by Mach. Release all ports even if one release fails, then release the array. The first error is retained. Repeated calls return the error without releasing anything again.

Member Data Documentation

◆ m_deallocator

macOS_thread_deallocator mysql::system_info::internal::macOS_thread_resources::m_deallocator
private

◆ m_release_error

std::error_code mysql::system_info::internal::macOS_thread_resources::m_release_error
private

◆ m_released

bool mysql::system_info::internal::macOS_thread_resources::m_released {false}
private

◆ m_thread_count

mach_msg_type_number_t mysql::system_info::internal::macOS_thread_resources::m_thread_count
private

◆ m_threads

thread_act_array_t mysql::system_info::internal::macOS_thread_resources::m_threads
private

The documentation for this class was generated from the following files: