aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/API/SBQueue.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2014-03-09 19:41:30 +0000
committerJason Molenda <jmolenda@apple.com>2014-03-09 19:41:30 +0000
commitfe95dc95b5c16997f15d59d216734aecdce0bb44 (patch)
treea85658d2618ed573c6d160f72badafd5bcc2e0cb /lldb/source/API/SBQueue.cpp
parent644aef8f84b29ab31b9c7bb0b5a647c1edc57c8e (diff)
downloadllvm-fe95dc95b5c16997f15d59d216734aecdce0bb44.zip
llvm-fe95dc95b5c16997f15d59d216734aecdce0bb44.tar.gz
llvm-fe95dc95b5c16997f15d59d216734aecdce0bb44.tar.bz2
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
Diffstat (limited to 'lldb/source/API/SBQueue.cpp')
-rw-r--r--lldb/source/API/SBQueue.cpp35
1 files changed, 29 insertions, 6 deletions
diff --git a/lldb/source/API/SBQueue.cpp b/lldb/source/API/SBQueue.cpp
index 0860bf9..cd914bc2 100644
--- a/lldb/source/API/SBQueue.cpp
+++ b/lldb/source/API/SBQueue.cpp
@@ -222,21 +222,24 @@ namespace lldb_private
}
return sb_thread;
}
-
-
+
uint32_t
GetNumPendingItems ()
{
uint32_t result = 0;
- FetchItems();
-
- if (m_pending_items_fetched)
+
+ QueueSP queue_sp = m_queue_wp.lock();
+ if (m_pending_items_fetched == false && queue_sp)
+ {
+ result = queue_sp->GetNumPendingWorkItems();
+ }
+ else
{
result = m_pending_items.size();
}
return result;
}
-
+
lldb::SBQueueItem
GetPendingItemAtIndex (uint32_t idx)
{
@@ -248,6 +251,16 @@ namespace lldb_private
}
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
GetProcess ()
@@ -399,6 +412,16 @@ SBQueue::GetPendingItemAtIndex (uint32_t 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
SBQueue::GetProcess ()
{