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

Side by Side Diff: src/d8.cc

Issue 7787013: Follow up fixes for r9205: shared library build and thread deletion. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 3 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 | « no previous file | 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 951 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 } 962 }
963 963
964 thread_context.Dispose(); 964 thread_context.Dispose();
965 ptr = next_line; 965 ptr = next_line;
966 } 966 }
967 } 967 }
968 #endif // V8_SHARED 968 #endif // V8_SHARED
969 969
970 970
971 SourceGroup::~SourceGroup() { 971 SourceGroup::~SourceGroup() {
972 #ifndef V8_SHARED
972 delete next_semaphore_; 973 delete next_semaphore_;
973 next_semaphore_ = NULL; 974 next_semaphore_ = NULL;
974 delete done_semaphore_; 975 delete done_semaphore_;
975 done_semaphore_ = NULL; 976 done_semaphore_ = NULL;
976 delete thread_; 977 delete thread_;
977 thread_ = NULL; 978 thread_ = NULL;
979 #endif // V8_SHARED
978 } 980 }
979 981
980 982
981 void SourceGroup::ExitShell(int exit_code) { 983 void SourceGroup::ExitShell(int exit_code) {
982 // Use _exit instead of exit to avoid races between isolate 984 // Use _exit instead of exit to avoid races between isolate
983 // threads and static destructors. 985 // threads and static destructors.
984 fflush(stdout); 986 fflush(stdout);
985 fflush(stderr); 987 fflush(stderr);
986 _exit(exit_code); 988 _exit(exit_code);
987 } 989 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 thread_->Start(); 1073 thread_->Start();
1072 } 1074 }
1073 next_semaphore_->Signal(); 1075 next_semaphore_->Signal();
1074 } 1076 }
1075 1077
1076 1078
1077 void SourceGroup::WaitForThread() { 1079 void SourceGroup::WaitForThread() {
1078 if (thread_ == NULL) return; 1080 if (thread_ == NULL) return;
1079 if (Shell::options.last_run) { 1081 if (Shell::options.last_run) {
1080 thread_->Join(); 1082 thread_->Join();
1081 thread_ = NULL;
1082 } else { 1083 } else {
1083 done_semaphore_->Wait(); 1084 done_semaphore_->Wait();
1084 } 1085 }
1085 } 1086 }
1086 #endif // V8_SHARED 1087 #endif // V8_SHARED
1087 1088
1088 1089
1089 bool Shell::SetOptions(int argc, char* argv[]) { 1090 bool Shell::SetOptions(int argc, char* argv[]) {
1090 for (int i = 0; i < argc; i++) { 1091 for (int i = 0; i < argc; i++) {
1091 if (strcmp(argv[i], "--stress-opt") == 0) { 1092 if (strcmp(argv[i], "--stress-opt") == 0) {
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
1324 } 1325 }
1325 1326
1326 } // namespace v8 1327 } // namespace v8
1327 1328
1328 1329
1329 #ifndef GOOGLE3 1330 #ifndef GOOGLE3
1330 int main(int argc, char* argv[]) { 1331 int main(int argc, char* argv[]) {
1331 return v8::Shell::Main(argc, argv); 1332 return v8::Shell::Main(argc, argv);
1332 } 1333 }
1333 #endif 1334 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698