LLDB mainline
Public Member Functions | Private Member Functions | Private Attributes | List of all members
lldb_private::Queue Class Reference

#include <Queue.h>

Inheritance diagram for lldb_private::Queue:
Inheritance graph
[legend]

Public Member Functions

 Queue (lldb::ProcessSP process_sp, lldb::queue_id_t queue_id, const char *queue_name)
 
 ~Queue ()
 
lldb::queue_id_t GetID ()
 Get the QueueID for this Queue.
 
const char * GetName ()
 Get the name of this Queue.
 
uint32_t GetIndexID ()
 Get the IndexID for this Queue.
 
std::vector< lldb::ThreadSPGetThreads ()
 Return the threads currently associated with this queue.
 
const std::vector< lldb::QueueItemSP > & GetPendingItems ()
 Return the items that are currently enqueued.
 
lldb::ProcessSP GetProcess () const
 
uint32_t GetNumRunningWorkItems () const
 Get the number of work items that this queue is currently running.
 
uint32_t GetNumPendingWorkItems () const
 Get the number of work items enqueued on this queue.
 
lldb::addr_t GetLibdispatchQueueAddress () const
 Get the dispatch_queue_t structure address for this Queue.
 
void SetNumRunningWorkItems (uint32_t count)
 
void SetNumPendingWorkItems (uint32_t count)
 
void SetLibdispatchQueueAddress (lldb::addr_t dispatch_queue_t_addr)
 
void PushPendingQueueItem (lldb::QueueItemSP item)
 
lldb::QueueKind GetKind ()
 Return the kind (serial, concurrent) of this queue.
 
void SetKind (lldb::QueueKind kind)
 

Private Member Functions

 Queue (const Queue &)=delete
 
const Queueoperator= (const Queue &)=delete
 

Private Attributes

lldb::ProcessWP m_process_wp
 
lldb::queue_id_t m_queue_id
 
std::string m_queue_name
 
uint32_t m_running_work_items_count
 
uint32_t m_pending_work_items_count
 
std::vector< lldb::QueueItemSPm_pending_items
 
lldb::addr_t m_dispatch_queue_t_addr
 
lldb::QueueKind m_kind
 

Detailed Description

Definition at line 32 of file Queue.h.

Constructor & Destructor Documentation

◆ Queue() [1/2]

Queue::Queue ( lldb::ProcessSP  process_sp,
lldb::queue_id_t  queue_id,
const char *  queue_name 
)

Definition at line 18 of file Queue.cpp.

References m_process_wp, and m_queue_name.

◆ ~Queue()

Queue::~Queue ( )
default

◆ Queue() [2/2]

lldb_private::Queue::Queue ( const Queue )
privatedelete

Member Function Documentation

◆ GetID()

queue_id_t Queue::GetID ( )

Get the QueueID for this Queue.

A 64-bit ID number that uniquely identifies a queue at this particular stop_id. Currently the libdispatch serialnum is used for the QueueID; it is a number that starts at 1 for each process and increments with each queue. A serialnum is not reused for a different queue in the lifetime of that process execution.

Returns
The QueueID for this Queue.

Definition at line 32 of file Queue.cpp.

References m_queue_id.

◆ GetIndexID()

uint32_t Queue::GetIndexID ( )

Get the IndexID for this Queue.

This is currently the same as GetID(). If it changes in the future, it will be a small integer value (starting with 1) assigned to each queue that is seen during a Process lifetime.

Both the GetID and GetIndexID are being retained for Queues to maintain similar API to the Thread class, and allow for the possibility of GetID changing to a different source in the future.

Returns
The IndexID for this queue.

Definition at line 38 of file Queue.cpp.

References m_queue_id.

◆ GetKind()

lldb::QueueKind Queue::GetKind ( )

Return the kind (serial, concurrent) of this queue.

Definition at line 87 of file Queue.cpp.

References m_kind.

◆ GetLibdispatchQueueAddress()

addr_t Queue::GetLibdispatchQueueAddress ( ) const

Get the dispatch_queue_t structure address for this Queue.

Get the address in the inferior process' memory of this Queue's dispatch_queue_t structure.

Returns
The address of the dispatch_queue_t structure, if known. LLDB_INVALID_ADDRESS will be returned if it is unavailable.

Definition at line 73 of file Queue.cpp.

References m_dispatch_queue_t_addr.

Referenced by SystemRuntimeMacOSX::PopulatePendingItemsForQueue().

◆ GetName()

const char * Queue::GetName ( )

Get the name of this Queue.

Returns
The name of the queue, if one is available. A NULL pointer is returned if none is available.

Definition at line 34 of file Queue.cpp.

References m_queue_name.

◆ GetNumPendingWorkItems()

uint32_t Queue::GetNumPendingWorkItems ( ) const

Get the number of work items enqueued on this queue.

Returns
The number of work items currently enqueued, waiting to execute.

Definition at line 65 of file Queue.cpp.

References m_pending_work_items_count.

◆ GetNumRunningWorkItems()

uint32_t Queue::GetNumRunningWorkItems ( ) const

Get the number of work items that this queue is currently running.

Returns
The number of work items currently executing. For a serial queue, this will be 0 or 1. For a concurrent queue, this may be any number.

Definition at line 57 of file Queue.cpp.

References m_running_work_items_count.

◆ GetPendingItems()

const std::vector< lldb::QueueItemSP > & Queue::GetPendingItems ( )

Return the items that are currently enqueued.

"Enqueued" means that the item has been added to the queue to be done, but has not yet been done. When the item is going to be processed it is "dequeued".

Returns
The vector of enqueued items for this queue

Definition at line 77 of file Queue.cpp.

References m_pending_items, and m_process_wp.

◆ GetProcess()

lldb::ProcessSP lldb_private::Queue::GetProcess ( ) const
inline

Definition at line 92 of file Queue.h.

References m_process_wp.

◆ GetThreads()

std::vector< lldb::ThreadSP > Queue::GetThreads ( )

Return the threads currently associated with this queue.

Zero, one, or many threads may be executing code for a queue at a given point in time. This call returns the list of threads that are currently executing work for this queue.

Returns
The threads currently performing work for this queue

Definition at line 40 of file Queue.cpp.

References m_process_wp, and m_queue_id.

◆ operator=()

const Queue & lldb_private::Queue::operator= ( const Queue )
privatedelete

◆ PushPendingQueueItem()

void lldb_private::Queue::PushPendingQueueItem ( lldb::QueueItemSP  item)
inline

Definition at line 125 of file Queue.h.

References m_pending_items.

Referenced by SystemRuntimeMacOSX::PopulatePendingItemsForQueue().

◆ SetKind()

void Queue::SetKind ( lldb::QueueKind  kind)

Definition at line 89 of file Queue.cpp.

References m_kind.

◆ SetLibdispatchQueueAddress()

void Queue::SetLibdispatchQueueAddress ( lldb::addr_t  dispatch_queue_t_addr)

Definition at line 69 of file Queue.cpp.

References m_dispatch_queue_t_addr.

◆ SetNumPendingWorkItems()

void Queue::SetNumPendingWorkItems ( uint32_t  count)

Definition at line 61 of file Queue.cpp.

References m_pending_work_items_count.

◆ SetNumRunningWorkItems()

void Queue::SetNumRunningWorkItems ( uint32_t  count)

Definition at line 53 of file Queue.cpp.

References m_running_work_items_count.

Member Data Documentation

◆ m_dispatch_queue_t_addr

lldb::addr_t lldb_private::Queue::m_dispatch_queue_t_addr
private

Definition at line 143 of file Queue.h.

Referenced by GetLibdispatchQueueAddress(), and SetLibdispatchQueueAddress().

◆ m_kind

lldb::QueueKind lldb_private::Queue::m_kind
private

Definition at line 145 of file Queue.h.

Referenced by GetKind(), and SetKind().

◆ m_pending_items

std::vector<lldb::QueueItemSP> lldb_private::Queue::m_pending_items
private

Definition at line 142 of file Queue.h.

Referenced by GetPendingItems(), and PushPendingQueueItem().

◆ m_pending_work_items_count

uint32_t lldb_private::Queue::m_pending_work_items_count
private

Definition at line 141 of file Queue.h.

Referenced by GetNumPendingWorkItems(), and SetNumPendingWorkItems().

◆ m_process_wp

lldb::ProcessWP lldb_private::Queue::m_process_wp
private

Definition at line 137 of file Queue.h.

Referenced by GetPendingItems(), GetProcess(), GetThreads(), and Queue().

◆ m_queue_id

lldb::queue_id_t lldb_private::Queue::m_queue_id
private

Definition at line 138 of file Queue.h.

Referenced by GetID(), GetIndexID(), and GetThreads().

◆ m_queue_name

std::string lldb_private::Queue::m_queue_name
private

Definition at line 139 of file Queue.h.

Referenced by GetName(), and Queue().

◆ m_running_work_items_count

uint32_t lldb_private::Queue::m_running_work_items_count
private

Definition at line 140 of file Queue.h.

Referenced by GetNumRunningWorkItems(), and SetNumRunningWorkItems().


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