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

Unified Diff: gpu/command_buffer/client/share_group.cc

Issue 613843003: Avoid holding locks across sync IPCs in command buffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/client/program_info_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/share_group.cc
diff --git a/gpu/command_buffer/client/share_group.cc b/gpu/command_buffer/client/share_group.cc
index 96ab8d181be01ab52edda453043ad4bbd451bf78..46413d17a8c07e0faf1b159049d14d156d284e88 100644
--- a/gpu/command_buffer/client/share_group.cc
+++ b/gpu/command_buffer/client/share_group.cc
@@ -49,18 +49,21 @@ class IdHandler : public IdHandlerInterface {
virtual bool FreeIds(
GLES2Implementation* gl_impl,
GLsizei n, const GLuint* ids, DeleteFn delete_fn) OVERRIDE {
- base::AutoLock auto_lock(lock_);
-
- for (GLsizei ii = 0; ii < n; ++ii) {
- id_allocator_.FreeID(ids[ii]);
- }
-
+ // Possibly may do a synchronous ipc, so can't hold a lock across it on
+ // pepper: http://crbug.com/418651
(gl_impl->*delete_fn)(n, ids);
// We need to ensure that the delete call is evaluated on the service side
// before any other contexts issue commands using these client ids.
// TODO(vmiura): Can remove this by virtualizing internal ids, however
// this code only affects PPAPI for now.
gl_impl->helper()->CommandBufferHelper::Flush();
+
+ base::AutoLock auto_lock(lock_);
+
+ for (GLsizei ii = 0; ii < n; ++ii) {
+ id_allocator_.FreeID(ids[ii]);
+ }
piman 2014/10/02 21:44:02 I think this change would cause a potential race i
Peng 2014/12/05 18:16:42 I think delete_fn and Flush() do not use sync IPC
piman 2014/12/05 20:51:49 delete_fn will use a sync IPC in some cases, e.g.
+
return true;
}
« no previous file with comments | « gpu/command_buffer/client/program_info_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698