OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 lazily_archived_thread_(ThreadId::Invalid()), | 298 lazily_archived_thread_(ThreadId::Invalid()), |
299 lazily_archived_thread_state_(NULL), | 299 lazily_archived_thread_state_(NULL), |
300 free_anchor_(NULL), | 300 free_anchor_(NULL), |
301 in_use_anchor_(NULL) { | 301 in_use_anchor_(NULL) { |
302 free_anchor_ = new ThreadState(this); | 302 free_anchor_ = new ThreadState(this); |
303 in_use_anchor_ = new ThreadState(this); | 303 in_use_anchor_ = new ThreadState(this); |
304 } | 304 } |
305 | 305 |
306 | 306 |
307 ThreadManager::~ThreadManager() { | 307 ThreadManager::~ThreadManager() { |
308 // TODO(isolates): Destroy mutexes. | 308 delete mutex_; |
| 309 delete free_anchor_; |
| 310 delete in_use_anchor_; |
309 } | 311 } |
310 | 312 |
311 | 313 |
312 void ThreadManager::ArchiveThread() { | 314 void ThreadManager::ArchiveThread() { |
313 ASSERT(lazily_archived_thread_.Equals(ThreadId::Invalid())); | 315 ASSERT(lazily_archived_thread_.Equals(ThreadId::Invalid())); |
314 ASSERT(!IsArchived()); | 316 ASSERT(!IsArchived()); |
315 ASSERT(IsLockedByCurrentThread()); | 317 ASSERT(IsLockedByCurrentThread()); |
316 ThreadState* state = GetFreeThreadState(); | 318 ThreadState* state = GetFreeThreadState(); |
317 state->Unlink(); | 319 state->Unlink(); |
318 Isolate::PerIsolateThreadData* per_thread = | 320 Isolate::PerIsolateThreadData* per_thread = |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 // Acknowledge the preemption by the receiving thread. | 463 // Acknowledge the preemption by the receiving thread. |
462 void ContextSwitcher::PreemptionReceived() { | 464 void ContextSwitcher::PreemptionReceived() { |
463 ASSERT(Locker::IsLocked()); | 465 ASSERT(Locker::IsLocked()); |
464 // There is currently no accounting being done for this. But could be in the | 466 // There is currently no accounting being done for this. But could be in the |
465 // future, which is why we leave this in. | 467 // future, which is why we leave this in. |
466 } | 468 } |
467 | 469 |
468 | 470 |
469 } // namespace internal | 471 } // namespace internal |
470 } // namespace v8 | 472 } // namespace v8 |
OLD | NEW |