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

Unified Diff: src/d8.h

Issue 1252623003: [d8] Fix tsan bugs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: re-enable d8-worker-sharedarraybuffer Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/d8.cc » ('j') | src/d8.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8.h
diff --git a/src/d8.h b/src/d8.h
index 4e217640af1b13c63d6470ec497daaa9ae1c6887..c7a43db059e4ce33a8f8b56276161678e3ccbe60 100644
--- a/src/d8.h
+++ b/src/d8.h
@@ -293,9 +293,7 @@ class Worker {
class ShellOptions {
public:
ShellOptions()
- : script_executed(false),
- last_run(true),
- send_idle_notification(false),
+ : send_idle_notification(false),
invoke_weak_callbacks(false),
omit_quit(false),
stress_opt(false),
@@ -310,18 +308,30 @@ class ShellOptions {
isolate_sources(NULL),
icu_data_file(NULL),
natives_blob(NULL),
- snapshot_blob(NULL) {}
+ snapshot_blob(NULL),
+ script_executed_(false),
+ last_run_(true) {}
~ShellOptions() {
delete[] isolate_sources;
}
bool use_interactive_shell() {
- return (interactive_shell || !script_executed) && !test_shell;
+ return (interactive_shell || !script_executed()) && !test_shell;
+ }
+
+ bool script_executed() { return base::NoBarrier_Load(&script_executed_); }
+
+ void set_script_executed(bool value) {
+ return base::NoBarrier_Store(&script_executed_, value);
+ }
+
+ bool last_run() { return base::NoBarrier_Load(&last_run_); }
+
+ void set_last_run(bool value) {
+ return base::NoBarrier_Store(&last_run_, value);
}
- bool script_executed;
- bool last_run;
bool send_idle_notification;
bool invoke_weak_callbacks;
bool omit_quit;
@@ -338,6 +348,10 @@ class ShellOptions {
const char* icu_data_file;
const char* natives_blob;
const char* snapshot_blob;
+
+ private:
+ base::Atomic32 script_executed_;
+ base::Atomic32 last_run_;
};
#ifdef V8_SHARED
« no previous file with comments | « no previous file | src/d8.cc » ('j') | src/d8.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698