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

Unified Diff: base/waitable_event_watcher_posix.cc

Issue 271033: Multiple sync channels if used in the same listener thread could result in ca... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | « base/waitable_event_watcher.h ('k') | chrome/browser/renderer_host/browser_render_process_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/waitable_event_watcher_posix.cc
===================================================================
--- base/waitable_event_watcher_posix.cc (revision 28676)
+++ base/waitable_event_watcher_posix.cc (working copy)
@@ -122,7 +122,8 @@
: event_(NULL),
message_loop_(NULL),
cancel_flag_(NULL),
- callback_task_(NULL) {
+ callback_task_(NULL),
+ delegate_(NULL) {
}
WaitableEventWatcher::~WaitableEventWatcher() {
@@ -159,6 +160,9 @@
AutoLock locked(kernel->lock_);
+ delegate_ = delegate;
+ event_ = event;
+
if (kernel->signaled_) {
if (!kernel->manual_reset_)
kernel->signaled_ = false;
@@ -172,7 +176,6 @@
message_loop_ = current_ml;
current_ml->AddDestructionObserver(this);
- event_ = event;
kernel_ = kernel;
waiter_ = new AsyncWaiter(current_ml, callback_task_, cancel_flag_);
event->Enqueue(waiter_);
@@ -181,6 +184,8 @@
}
void WaitableEventWatcher::StopWatching() {
+ delegate_ = NULL;
+
if (message_loop_) {
message_loop_->RemoveDestructionObserver(this);
message_loop_ = NULL;
« no previous file with comments | « base/waitable_event_watcher.h ('k') | chrome/browser/renderer_host/browser_render_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698