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

Unified Diff: ipc/ipc_sync_channel.cc

Issue 234253002: DCHECK that listener thread != IO thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Back to weaker check in ChannelProxy for now. Created 6 years, 8 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 | « ipc/ipc_channel_proxy.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_sync_channel.cc
diff --git a/ipc/ipc_sync_channel.cc b/ipc/ipc_sync_channel.cc
index b2e79a86f7363b289330cf53207e1021a801ead6..9e04f61dbca13f740c1fb5e47fea9f26e99aeebd 100644
--- a/ipc/ipc_sync_channel.cc
+++ b/ipc/ipc_sync_channel.cc
@@ -412,6 +412,9 @@ SyncChannel::SyncChannel(
bool create_pipe_now,
WaitableEvent* shutdown_event)
: ChannelProxy(new SyncContext(listener, ipc_task_runner, shutdown_event)) {
+ // The current (listener) thread must be distinct from the IPC thread, or else
+ // sending synchronous messages will deadlock.
+ DCHECK_NE(ipc_task_runner, base::ThreadTaskRunnerHandle::Get());
ChannelProxy::Init(channel_handle, mode, create_pipe_now);
StartWatching();
}
@@ -421,6 +424,9 @@ SyncChannel::SyncChannel(
base::SingleThreadTaskRunner* ipc_task_runner,
WaitableEvent* shutdown_event)
: ChannelProxy(new SyncContext(listener, ipc_task_runner, shutdown_event)) {
+ // The current (listener) thread must be distinct from the IPC thread, or else
+ // sending synchronous messages will deadlock.
+ DCHECK_NE(ipc_task_runner, base::ThreadTaskRunnerHandle::Get());
StartWatching();
}
« no previous file with comments | « ipc/ipc_channel_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698