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

Unified Diff: src/debug.h

Issue 631223004: Fix data race on Debug::thread_local_.current_debug_scope_ (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.h
diff --git a/src/debug.h b/src/debug.h
index 9b14afcb34914b9c0d0c8741c965ab69b1c846be..a95ecf27e847ab12b12ac375c1468d655bbb1d7c 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -8,6 +8,7 @@
#include "src/allocation.h"
#include "src/arguments.h"
#include "src/assembler.h"
+#include "src/base/atomicops.h"
#include "src/base/platform/platform.h"
#include "src/execution.h"
#include "src/factory.h"
@@ -459,7 +460,10 @@ class Debug {
}
// Flags and states.
- DebugScope* debugger_entry() { return thread_local_.current_debug_scope_; }
+ DebugScope* debugger_entry() {
+ return reinterpret_cast<DebugScope*>(
+ base::NoBarrier_Load(&thread_local_.current_debug_scope_));
+ }
inline Handle<Context> debug_context() { return debug_context_; }
void set_live_edit_enabled(bool v) { live_edit_enabled_ = v; }
bool live_edit_enabled() const {
@@ -470,7 +474,7 @@ class Debug {
inline bool is_loaded() const { return !debug_context_.is_null(); }
inline bool has_break_points() const { return has_break_points_; }
inline bool in_debug_scope() const {
- return thread_local_.current_debug_scope_ != NULL;
+ return !!base::NoBarrier_Load(&thread_local_.current_debug_scope_);
}
void set_disable_break(bool v) { break_disabled_ = v; }
@@ -599,7 +603,7 @@ class Debug {
class ThreadLocal {
public:
// Top debugger entry.
- DebugScope* current_debug_scope_;
+ base::AtomicWord current_debug_scope_;
// Counter for generating next break id.
int break_count_;
« no previous file with comments | « no previous file | src/debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698