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

Unified Diff: src/vm/process_handle.h

Issue 1405293007: Bugfix in process handle: Do detaching from owner process separately from derefing. (Closed) Base URL: git@github.com:dart-lang/fletch.git@master
Patch Set: Created 5 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 | « src/vm/process.cc ('k') | src/vm/refcounted.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/vm/process_handle.h
diff --git a/src/vm/process_handle.h b/src/vm/process_handle.h
index db9550c401b00fbb21d4d0c89e24dadfff2a4ccb..322ac639ad4b7b517d8c9017c409425e3ee5cfbe 100644
--- a/src/vm/process_handle.h
+++ b/src/vm/process_handle.h
@@ -25,15 +25,10 @@ class ProcessHandle : public Refcounted<ProcessHandle> {
private:
friend class Process;
- static void OwnerProcessTerminating(ProcessHandle* handle) {
- handle->lock()->Lock();
- ASSERT(handle->process_ != NULL);
- handle->process_ = NULL;
- if (!handle->DecrementRefWithoutDelete()) {
- handle->lock()->Unlock();
kustermann 2015/10/29 11:17:20 The DecrementRefWithoutDelete() & Unlock/Delete is
- } else {
- delete handle;
- }
+ void OwnerProcessTerminating() {
+ ScopedSpinlock locker(&spinlock_);
+ ASSERT(process_ != NULL);
+ process_ = NULL;
}
Process* process_;
« no previous file with comments | « src/vm/process.cc ('k') | src/vm/refcounted.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698