Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Side by Side Diff: src/v8threads.cc

Issue 7309013: Fix a few issues breaking cctest/test-lockers/Regress1433: (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/runtime-profiler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 28 matching lines...) Expand all
39 39
40 // Track whether this V8 instance has ever called v8::Locker. This allows the 40 // Track whether this V8 instance has ever called v8::Locker. This allows the
41 // API code to verify that the lock is always held when V8 is being entered. 41 // API code to verify that the lock is always held when V8 is being entered.
42 bool Locker::active_ = false; 42 bool Locker::active_ = false;
43 43
44 44
45 // Constructor for the Locker object. Once the Locker is constructed the 45 // Constructor for the Locker object. Once the Locker is constructed the
46 // current thread will be guaranteed to have the lock for a given isolate. 46 // current thread will be guaranteed to have the lock for a given isolate.
47 Locker::Locker(v8::Isolate* isolate) 47 Locker::Locker(v8::Isolate* isolate)
48 : has_lock_(false), 48 : has_lock_(false),
49 top_level_(false), 49 top_level_(true),
50 isolate_(reinterpret_cast<i::Isolate*>(isolate)) { 50 isolate_(reinterpret_cast<i::Isolate*>(isolate)) {
51 if (isolate_ == NULL) { 51 if (isolate_ == NULL) {
52 isolate_ = i::Isolate::GetDefaultIsolateForLocking(); 52 isolate_ = i::Isolate::GetDefaultIsolateForLocking();
53 } 53 }
54 // Record that the Locker has been used at least once. 54 // Record that the Locker has been used at least once.
55 active_ = true; 55 active_ = true;
56 // Get the big lock if necessary. 56 // Get the big lock if necessary.
57 if (!isolate_->thread_manager()->IsLockedByCurrentThread()) { 57 if (!isolate_->thread_manager()->IsLockedByCurrentThread()) {
58 isolate_->thread_manager()->Lock(); 58 isolate_->thread_manager()->Lock();
59 has_lock_ = true; 59 has_lock_ = true;
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 // Acknowledge the preemption by the receiving thread. 456 // Acknowledge the preemption by the receiving thread.
457 void ContextSwitcher::PreemptionReceived() { 457 void ContextSwitcher::PreemptionReceived() {
458 ASSERT(Locker::IsLocked()); 458 ASSERT(Locker::IsLocked());
459 // There is currently no accounting being done for this. But could be in the 459 // There is currently no accounting being done for this. But could be in the
460 // future, which is why we leave this in. 460 // future, which is why we leave this in.
461 } 461 }
462 462
463 463
464 } // namespace internal 464 } // namespace internal
465 } // namespace v8 465 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime-profiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698