Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 1 | // Copyright 2011 Google Inc. All Rights Reserved. |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 2 | |
| 3 | #ifndef ART_SRC_THREAD_H_ |
| 4 | #define ART_SRC_THREAD_H_ |
| 5 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 6 | #include <pthread.h> |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 7 | #include <list> |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 8 | |
Brian Carlstrom | 578bbdc | 2011-07-21 14:07:47 -0700 | [diff] [blame] | 9 | #include "globals.h" |
Brian Carlstrom | 578bbdc | 2011-07-21 14:07:47 -0700 | [diff] [blame] | 10 | #include "logging.h" |
| 11 | #include "macros.h" |
Brian Carlstrom | b765be0 | 2011-08-17 23:54:10 -0700 | [diff] [blame] | 12 | #include "mem_map.h" |
Brian Carlstrom | 578bbdc | 2011-07-21 14:07:47 -0700 | [diff] [blame] | 13 | #include "offsets.h" |
| 14 | #include "runtime.h" |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 15 | |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 16 | #include "jni.h" |
| 17 | |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 18 | namespace art { |
| 19 | |
Brian Carlstrom | a40f9bc | 2011-07-26 21:26:07 -0700 | [diff] [blame] | 20 | class Method; |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 21 | class Object; |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 22 | class Runtime; |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 23 | class StackHandleBlock; |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 24 | class Thread; |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 25 | class ThreadList; |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 26 | |
| 27 | class Mutex { |
| 28 | public: |
| 29 | virtual ~Mutex() {} |
| 30 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 31 | void Lock(); |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 32 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 33 | bool TryLock(); |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 34 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 35 | void Unlock(); |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 36 | |
| 37 | const char* GetName() { return name_; } |
| 38 | |
| 39 | Thread* GetOwner() { return owner_; } |
| 40 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 41 | static Mutex* Create(const char* name); |
| 42 | |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 43 | public: // TODO: protected |
| 44 | explicit Mutex(const char* name) : name_(name), owner_(NULL) {} |
| 45 | |
| 46 | void SetOwner(Thread* thread) { owner_ = thread; } |
| 47 | |
| 48 | private: |
| 49 | const char* name_; |
| 50 | |
| 51 | Thread* owner_; |
| 52 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 53 | pthread_mutex_t lock_impl_; |
| 54 | |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 55 | DISALLOW_COPY_AND_ASSIGN(Mutex); |
| 56 | }; |
| 57 | |
| 58 | class MutexLock { |
| 59 | public: |
| 60 | explicit MutexLock(Mutex *mu) : mu_(mu) { |
| 61 | mu_->Lock(); |
| 62 | } |
| 63 | ~MutexLock() { mu_->Unlock(); } |
| 64 | private: |
| 65 | Mutex* const mu_; |
| 66 | DISALLOW_COPY_AND_ASSIGN(MutexLock); |
| 67 | }; |
| 68 | |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 69 | // Stack handle blocks are allocated within the bridge frame between managed |
| 70 | // and native code. |
| 71 | class StackHandleBlock { |
| 72 | public: |
| 73 | // Number of references contained within this SHB |
| 74 | size_t NumberOfReferences() { |
| 75 | return number_of_references_; |
| 76 | } |
| 77 | |
| 78 | // Link to previous SHB or NULL |
| 79 | StackHandleBlock* Link() { |
| 80 | return link_; |
| 81 | } |
| 82 | |
| 83 | // Offset of length within SHB, used by generated code |
| 84 | static size_t NumberOfReferencesOffset() { |
| 85 | return OFFSETOF_MEMBER(StackHandleBlock, number_of_references_); |
| 86 | } |
| 87 | |
| 88 | // Offset of link within SHB, used by generated code |
| 89 | static size_t LinkOffset() { |
| 90 | return OFFSETOF_MEMBER(StackHandleBlock, link_); |
| 91 | } |
| 92 | |
| 93 | private: |
| 94 | StackHandleBlock() {} |
| 95 | |
| 96 | size_t number_of_references_; |
| 97 | StackHandleBlock* link_; |
| 98 | |
| 99 | DISALLOW_COPY_AND_ASSIGN(StackHandleBlock); |
| 100 | }; |
| 101 | |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 102 | class Thread { |
| 103 | public: |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 104 | enum State { |
| 105 | kUnknown = -1, |
| 106 | kNew, |
| 107 | kRunnable, |
| 108 | kBlocked, |
| 109 | kWaiting, |
| 110 | kTimedWaiting, |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 111 | kNative, |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 112 | kTerminated, |
| 113 | }; |
| 114 | |
Carl Shapiro | 61e019d | 2011-07-14 16:53:09 -0700 | [diff] [blame] | 115 | static const size_t kDefaultStackSize = 64 * KB; |
| 116 | |
| 117 | // Creates a new thread. |
Brian Carlstrom | b765be0 | 2011-08-17 23:54:10 -0700 | [diff] [blame] | 118 | static Thread* Create(const Runtime* runtime); |
Carl Shapiro | 61e019d | 2011-07-14 16:53:09 -0700 | [diff] [blame] | 119 | |
| 120 | // Creates a new thread from the calling thread. |
Elliott Hughes | 515a5bc | 2011-08-17 11:08:34 -0700 | [diff] [blame] | 121 | static Thread* Attach(const Runtime* runtime); |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 122 | |
| 123 | static Thread* Current() { |
Carl Shapiro | d0e7e77 | 2011-07-15 14:31:01 -0700 | [diff] [blame] | 124 | void* thread = pthread_getspecific(Thread::pthread_key_self_); |
| 125 | return reinterpret_cast<Thread*>(thread); |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 126 | } |
| 127 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 128 | uint32_t GetId() const { |
| 129 | return id_; |
| 130 | } |
| 131 | |
| 132 | pid_t GetNativeId() const { |
| 133 | return native_id_; |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 134 | } |
| 135 | |
| 136 | bool IsExceptionPending() const { |
Elliott Hughes | b20a554 | 2011-08-12 18:03:12 -0700 | [diff] [blame] | 137 | return exception_ != NULL; |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 138 | } |
| 139 | |
| 140 | Object* GetException() const { |
| 141 | return exception_; |
| 142 | } |
| 143 | |
| 144 | void SetException(Object* new_exception) { |
| 145 | CHECK(new_exception != NULL); |
| 146 | // TODO: CHECK(exception_ == NULL); |
| 147 | exception_ = new_exception; // TODO |
| 148 | } |
| 149 | |
Elliott Hughes | a5b897e | 2011-08-16 11:33:06 -0700 | [diff] [blame] | 150 | void ThrowNewException(const char* exception_class_name, const char* fmt, ...) |
| 151 | __attribute__ ((format(printf, 3, 4))); |
| 152 | |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 153 | void ClearException() { |
| 154 | exception_ = NULL; |
| 155 | } |
| 156 | |
Ian Rogers | 45a76cb | 2011-07-21 22:00:15 -0700 | [diff] [blame] | 157 | // Offset of exception within Thread, used by generated code |
| 158 | static ThreadOffset ExceptionOffset() { |
| 159 | return ThreadOffset(OFFSETOF_MEMBER(Thread, exception_)); |
| 160 | } |
| 161 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 162 | void SetName(const char* name); |
| 163 | |
| 164 | void Suspend(); |
| 165 | |
| 166 | bool IsSuspended(); |
| 167 | |
| 168 | void Resume(); |
| 169 | |
| 170 | static bool Init(); |
| 171 | |
Carl Shapiro | 69759ea | 2011-07-21 18:13:35 -0700 | [diff] [blame] | 172 | Runtime* GetRuntime() const { |
| 173 | return runtime_; |
| 174 | } |
| 175 | |
Elliott Hughes | 330304d | 2011-08-12 14:28:05 -0700 | [diff] [blame] | 176 | State GetState() const { |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 177 | return state_; |
| 178 | } |
| 179 | |
| 180 | void SetState(State new_state) { |
| 181 | state_ = new_state; |
| 182 | } |
| 183 | |
Ian Rogers | 45a76cb | 2011-07-21 22:00:15 -0700 | [diff] [blame] | 184 | static ThreadOffset SuspendCountOffset() { |
| 185 | return ThreadOffset(OFFSETOF_MEMBER(Thread, suspend_count_)); |
| 186 | } |
| 187 | |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 188 | // Offset of state within Thread, used by generated code |
| 189 | static ThreadOffset StateOffset() { |
| 190 | return ThreadOffset(OFFSETOF_MEMBER(Thread, state_)); |
| 191 | } |
| 192 | |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 193 | // JNI methods |
Elliott Hughes | 40ef99e | 2011-08-11 17:44:34 -0700 | [diff] [blame] | 194 | JNIEnv* GetJniEnv() const { |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 195 | return jni_env_; |
| 196 | } |
| 197 | |
| 198 | // Offset of JNI environment within Thread, used by generated code |
| 199 | static ThreadOffset JniEnvOffset() { |
| 200 | return ThreadOffset(OFFSETOF_MEMBER(Thread, jni_env_)); |
| 201 | } |
| 202 | |
Ian Rogers | 45a76cb | 2011-07-21 22:00:15 -0700 | [diff] [blame] | 203 | // Offset of top of managed stack address, used by generated code |
| 204 | static ThreadOffset TopOfManagedStackOffset() { |
| 205 | return ThreadOffset(OFFSETOF_MEMBER(Thread, top_of_managed_stack_)); |
| 206 | } |
| 207 | |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 208 | // Offset of top stack handle block within Thread, used by generated code |
| 209 | static ThreadOffset TopShbOffset() { |
| 210 | return ThreadOffset(OFFSETOF_MEMBER(Thread, top_shb_)); |
| 211 | } |
| 212 | |
| 213 | // Number of references allocated in StackHandleBlocks on this thread |
| 214 | size_t NumShbHandles() { |
| 215 | size_t count = 0; |
| 216 | for (StackHandleBlock* cur = top_shb_; cur; cur = cur->Link()) { |
| 217 | count += cur->NumberOfReferences(); |
| 218 | } |
| 219 | return count; |
| 220 | } |
| 221 | |
Ian Rogers | 45a76cb | 2011-07-21 22:00:15 -0700 | [diff] [blame] | 222 | // Offset of exception_entry_point_ within Thread, used by generated code |
| 223 | static ThreadOffset ExceptionEntryPointOffset() { |
| 224 | return ThreadOffset(OFFSETOF_MEMBER(Thread, exception_entry_point_)); |
| 225 | } |
| 226 | |
| 227 | void RegisterExceptionEntryPoint(void (*handler)(Method**)) { |
| 228 | exception_entry_point_ = handler; |
| 229 | } |
| 230 | |
| 231 | // Offset of suspend_count_entry_point_ within Thread, used by generated code |
| 232 | static ThreadOffset SuspendCountEntryPointOffset() { |
| 233 | return ThreadOffset(OFFSETOF_MEMBER(Thread, suspend_count_entry_point_)); |
| 234 | } |
| 235 | |
| 236 | void RegisterSuspendCountEntryPoint(void (*handler)(Method**)) { |
| 237 | suspend_count_entry_point_ = handler; |
| 238 | } |
| 239 | |
| 240 | // Increasing the suspend count, will cause the thread to run to safepoint |
| 241 | void IncrementSuspendCount() { suspend_count_++; } |
| 242 | void DecrementSuspendCount() { suspend_count_--; } |
| 243 | |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 244 | private: |
Elliott Hughes | 40ef99e | 2011-08-11 17:44:34 -0700 | [diff] [blame] | 245 | Thread() |
Elliott Hughes | 330304d | 2011-08-12 14:28:05 -0700 | [diff] [blame] | 246 | : id_(1234), |
| 247 | top_shb_(NULL), |
| 248 | jni_env_(NULL), |
| 249 | exception_(NULL), |
| 250 | suspend_count_(0) { |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 251 | } |
Carl Shapiro | 69759ea | 2011-07-21 18:13:35 -0700 | [diff] [blame] | 252 | |
Ian Rogers | df20fe0 | 2011-07-20 20:34:16 -0700 | [diff] [blame] | 253 | ~Thread() { |
| 254 | delete jni_env_; |
| 255 | } |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 256 | |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 257 | void InitCpu(); |
| 258 | |
Carl Shapiro | 69759ea | 2011-07-21 18:13:35 -0700 | [diff] [blame] | 259 | // Managed thread id. |
| 260 | uint32_t id_; |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 261 | |
Ian Rogers | 45a76cb | 2011-07-21 22:00:15 -0700 | [diff] [blame] | 262 | // Top of the managed stack, written out prior to the state transition from |
| 263 | // kRunnable to kNative. Uses include to give the starting point for scanning |
| 264 | // a managed stack when a thread is in native code. |
| 265 | void* top_of_managed_stack_; |
| 266 | |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 267 | // Top of linked list of stack handle blocks or NULL for none |
| 268 | StackHandleBlock* top_shb_; |
| 269 | |
| 270 | // Every thread may have an associated JNI environment |
Elliott Hughes | 40ef99e | 2011-08-11 17:44:34 -0700 | [diff] [blame] | 271 | JNIEnv* jni_env_; |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 272 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 273 | State state_; |
| 274 | |
Carl Shapiro | 69759ea | 2011-07-21 18:13:35 -0700 | [diff] [blame] | 275 | // Native (kernel) thread id. |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 276 | pid_t native_id_; |
| 277 | |
Carl Shapiro | 69759ea | 2011-07-21 18:13:35 -0700 | [diff] [blame] | 278 | // Native thread handle. |
Carl Shapiro | 61e019d | 2011-07-14 16:53:09 -0700 | [diff] [blame] | 279 | pthread_t handle_; |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 280 | |
Carl Shapiro | 69759ea | 2011-07-21 18:13:35 -0700 | [diff] [blame] | 281 | // Initialized to "this". On certain architectures (such as x86) reading |
| 282 | // off of Thread::Current is easy but getting the address of Thread::Current |
| 283 | // is hard. This field can be read off of Thread::Current to give the address. |
| 284 | Thread* self_; |
| 285 | |
| 286 | Runtime* runtime_; |
| 287 | |
| 288 | // The pending exception or NULL. |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 289 | Object* exception_; |
| 290 | |
Ian Rogers | 45a76cb | 2011-07-21 22:00:15 -0700 | [diff] [blame] | 291 | // A non-zero value is used to tell the current thread to enter a safe point |
| 292 | // at the next poll. |
| 293 | int suspend_count_; |
| 294 | |
Brian Carlstrom | b765be0 | 2011-08-17 23:54:10 -0700 | [diff] [blame] | 295 | // The memory mapping of the stack for non-attached threads. |
| 296 | scoped_ptr<MemMap> stack_; |
| 297 | |
Carl Shapiro | 69759ea | 2011-07-21 18:13:35 -0700 | [diff] [blame] | 298 | // The inclusive base of the control stack. |
Carl Shapiro | 61e019d | 2011-07-14 16:53:09 -0700 | [diff] [blame] | 299 | byte* stack_base_; |
Carl Shapiro | 69759ea | 2011-07-21 18:13:35 -0700 | [diff] [blame] | 300 | |
| 301 | // The exclusive limit of the control stack. |
Carl Shapiro | 61e019d | 2011-07-14 16:53:09 -0700 | [diff] [blame] | 302 | byte* stack_limit_; |
| 303 | |
Carl Shapiro | 69759ea | 2011-07-21 18:13:35 -0700 | [diff] [blame] | 304 | // TLS key used to retrieve the VM thread object. |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 305 | static pthread_key_t pthread_key_self_; |
| 306 | |
Ian Rogers | 45a76cb | 2011-07-21 22:00:15 -0700 | [diff] [blame] | 307 | // Entry point called when exception_ is set |
| 308 | void (*exception_entry_point_)(Method** frame); |
| 309 | |
| 310 | // Entry point called when suspend_count_ is non-zero |
| 311 | void (*suspend_count_entry_point_)(Method** frame); |
| 312 | |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 313 | DISALLOW_COPY_AND_ASSIGN(Thread); |
| 314 | }; |
Elliott Hughes | 330304d | 2011-08-12 14:28:05 -0700 | [diff] [blame] | 315 | std::ostream& operator<<(std::ostream& os, const Thread& thread); |
Ian Rogers | b033c75 | 2011-07-20 12:22:35 -0700 | [diff] [blame] | 316 | std::ostream& operator<<(std::ostream& os, const Thread::State& state); |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 317 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 318 | class ThreadList { |
| 319 | public: |
Carl Shapiro | 61e019d | 2011-07-14 16:53:09 -0700 | [diff] [blame] | 320 | static const int kMaxId = 0xFFFF; |
| 321 | static const int kInvalidId = 0; |
| 322 | static const int kMainId = 1; |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 323 | |
Carl Shapiro | 61e019d | 2011-07-14 16:53:09 -0700 | [diff] [blame] | 324 | static ThreadList* Create(); |
| 325 | |
| 326 | ~ThreadList(); |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 327 | |
| 328 | void Register(Thread* thread); |
| 329 | |
| 330 | void Unregister(Thread* thread); |
| 331 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 332 | void Lock() { |
| 333 | lock_->Lock(); |
| 334 | } |
| 335 | |
| 336 | void Unlock() { |
| 337 | lock_->Unlock(); |
| 338 | }; |
| 339 | |
| 340 | private: |
| 341 | ThreadList(); |
| 342 | |
| 343 | std::list<Thread*> list_; |
| 344 | |
| 345 | Mutex* lock_; |
| 346 | |
| 347 | DISALLOW_COPY_AND_ASSIGN(ThreadList); |
| 348 | }; |
| 349 | |
| 350 | class ThreadListLock { |
| 351 | public: |
| 352 | ThreadListLock(ThreadList* thread_list, Thread* current_thread) |
| 353 | : thread_list_(thread_list) { |
| 354 | if (current_thread == NULL) { // try to get it from TLS |
| 355 | current_thread = Thread::Current(); |
| 356 | } |
| 357 | Thread::State old_state; |
| 358 | if (current_thread != NULL) { |
| 359 | old_state = current_thread->GetState(); |
| 360 | current_thread->SetState(Thread::kWaiting); // TODO: VMWAIT |
| 361 | } else { |
| 362 | // happens during VM shutdown |
| 363 | old_state = Thread::kUnknown; // TODO: something else |
| 364 | } |
| 365 | thread_list_->Lock(); |
| 366 | if (current_thread != NULL) { |
| 367 | current_thread->SetState(old_state); |
| 368 | } |
| 369 | } |
| 370 | |
| 371 | ~ThreadListLock() { |
| 372 | thread_list_->Unlock(); |
| 373 | } |
| 374 | |
Carl Shapiro | b557353 | 2011-07-12 18:22:59 -0700 | [diff] [blame] | 375 | private: |
| 376 | ThreadList* thread_list_; |
| 377 | |
| 378 | DISALLOW_COPY_AND_ASSIGN(ThreadListLock); |
| 379 | }; |
| 380 | |
Carl Shapiro | 0e5d75d | 2011-07-06 18:28:37 -0700 | [diff] [blame] | 381 | } // namespace art |
| 382 | |
| 383 | #endif // ART_SRC_THREAD_H_ |