1 //===-- ThreadCollection.h --------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_ThreadCollection_h_
11 #define liblldb_ThreadCollection_h_
15 #include "lldb/lldb-private.h"
16 #include "lldb/Host/Mutex.h"
17 #include "lldb/Utility/Iterable.h"
19 namespace lldb_private {
21 class ThreadCollection
24 typedef std::vector<lldb::ThreadSP> collection;
25 typedef LockingAdaptedIterable<collection, lldb::ThreadSP, vector_adapter> ThreadIterable;
29 ThreadCollection(collection threads);
40 AddThread (const lldb::ThreadSP &thread_sp);
43 InsertThread (const lldb::ThreadSP &thread_sp, uint32_t idx);
45 // Note that "idx" is not the same as the "thread_index". It is a zero
46 // based index to accessing the current threads, whereas "thread_index"
47 // is a unique index assigned
49 GetThreadAtIndex (uint32_t idx);
51 virtual ThreadIterable
54 return ThreadIterable(m_threads, GetMutex());
68 } // namespace lldb_private
70 #endif // liblldb_ThreadCollection_h_