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

Unified Diff: src/heap/page-parallel-job.h

Issue 2050893003: Version 5.1.281.63 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@5.1
Patch Set: Created 4 years, 6 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 | « src/heap/mark-compact.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/page-parallel-job.h
diff --git a/src/heap/page-parallel-job.h b/src/heap/page-parallel-job.h
index 720e288fc8ed2ba940cdff4905c58e2c04dc61d9..02583c7818437440a60b1cdac7c7d30051b8c320 100644
--- a/src/heap/page-parallel-job.h
+++ b/src/heap/page-parallel-job.h
@@ -33,13 +33,20 @@ class Isolate;
template <typename JobTraits>
class PageParallelJob {
public:
- PageParallelJob(Heap* heap, CancelableTaskManager* cancelable_task_manager)
+ // PageParallelJob cannot dynamically create a semaphore because of a bug in
+ // glibc. See http://crbug.com/609249 and
+ // https://sourceware.org/bugzilla/show_bug.cgi?id=12674.
+ // The caller must provide a semaphore with value 0 and ensure that
+ // the lifetime of the semaphore is the same as the lifetime of the Isolate
+ // It is guaranteed that the semaphore value will be 0 after Run() call.
+ PageParallelJob(Heap* heap, CancelableTaskManager* cancelable_task_manager,
+ base::Semaphore* semaphore)
: heap_(heap),
cancelable_task_manager_(cancelable_task_manager),
items_(nullptr),
num_items_(0),
num_tasks_(0),
- pending_tasks_(new base::Semaphore(0)) {}
+ pending_tasks_(semaphore) {}
~PageParallelJob() {
Item* item = items_;
@@ -48,7 +55,6 @@ class PageParallelJob {
delete item;
item = next;
}
- delete pending_tasks_;
}
void AddPage(MemoryChunk* chunk, typename JobTraits::PerPageData data) {
« no previous file with comments | « src/heap/mark-compact.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698