forked from OSchip/llvm-project
SBQueue::GetNumPendingItems() should not force a fetch of the pending
items; the backing Queue object has the number of pending items already cached. Also, add SBQueue::GetNumRunningItems() to provide that information. <rdar://problem/16272016> llvm-svn: 203420
This commit is contained in:
parent
644aef8f84
commit
fe95dc95b5
|
@ -62,6 +62,9 @@ public:
|
||||||
lldb::SBQueueItem
|
lldb::SBQueueItem
|
||||||
GetPendingItemAtIndex (uint32_t);
|
GetPendingItemAtIndex (uint32_t);
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
GetNumRunningItems ();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class SBProcess;
|
friend class SBProcess;
|
||||||
|
|
||||||
|
|
|
@ -222,21 +222,24 @@ namespace lldb_private
|
||||||
}
|
}
|
||||||
return sb_thread;
|
return sb_thread;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uint32_t
|
uint32_t
|
||||||
GetNumPendingItems ()
|
GetNumPendingItems ()
|
||||||
{
|
{
|
||||||
uint32_t result = 0;
|
uint32_t result = 0;
|
||||||
FetchItems();
|
|
||||||
|
QueueSP queue_sp = m_queue_wp.lock();
|
||||||
if (m_pending_items_fetched)
|
if (m_pending_items_fetched == false && queue_sp)
|
||||||
|
{
|
||||||
|
result = queue_sp->GetNumPendingWorkItems();
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
result = m_pending_items.size();
|
result = m_pending_items.size();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
lldb::SBQueueItem
|
lldb::SBQueueItem
|
||||||
GetPendingItemAtIndex (uint32_t idx)
|
GetPendingItemAtIndex (uint32_t idx)
|
||||||
{
|
{
|
||||||
|
@ -248,6 +251,16 @@ namespace lldb_private
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
GetNumRunningItems ()
|
||||||
|
{
|
||||||
|
uint32_t result = 0;
|
||||||
|
QueueSP queue_sp = m_queue_wp.lock();
|
||||||
|
if (queue_sp)
|
||||||
|
result = queue_sp->GetNumRunningWorkItems();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
lldb::SBProcess
|
lldb::SBProcess
|
||||||
GetProcess ()
|
GetProcess ()
|
||||||
|
@ -399,6 +412,16 @@ SBQueue::GetPendingItemAtIndex (uint32_t idx)
|
||||||
return m_opaque_sp->GetPendingItemAtIndex (idx);
|
return m_opaque_sp->GetPendingItemAtIndex (idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t
|
||||||
|
SBQueue::GetNumRunningItems ()
|
||||||
|
{
|
||||||
|
uint32_t running_items = m_opaque_sp->GetNumRunningItems ();
|
||||||
|
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
|
||||||
|
if (log)
|
||||||
|
log->Printf("SBQueue(0x%" PRIx64 ")::GetNumRunningItems() == %d", m_opaque_sp->GetQueueID(), running_items);
|
||||||
|
return running_items;
|
||||||
|
}
|
||||||
|
|
||||||
SBProcess
|
SBProcess
|
||||||
SBQueue::GetProcess ()
|
SBQueue::GetProcess ()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue