Chromium Code Reviews| Index: ui/gfx/gl/gl_implementation_linux.cc |
| diff --git a/ui/gfx/gl/gl_implementation_linux.cc b/ui/gfx/gl/gl_implementation_linux.cc |
| index 97e30877bc4ad49fe35958f56c8a366dc0975a42..0aac9697116869c4d185ea033be05c74d89a0d41 100644 |
| --- a/ui/gfx/gl/gl_implementation_linux.cc |
| +++ b/ui/gfx/gl/gl_implementation_linux.cc |
| @@ -10,6 +10,7 @@ |
| #include "base/logging.h" |
| #include "base/native_library.h" |
| #include "base/path_service.h" |
| +#include "base/synchronization/lock.h" |
| #include "ui/gfx/gl/gl_bindings.h" |
| #include "ui/gfx/gl/gl_implementation.h" |
| @@ -43,9 +44,18 @@ base::NativeLibrary LoadLibrary(const char* filename) { |
| return LoadLibrary(FilePath(filename)); |
| } |
| +// TODO(backer): Find a more principled (less heavy handed) way to prevent a |
| +// race in the bindings initialization. |
| +#if defined(TOUCH_UI) |
| +base::Lock g_lock; |
|
Ken Russell (switch to Gerrit)
2011/08/25 04:19:54
This isn't legal according to the Google C++ style
|
| +#endif |
| + |
| } // namespace anonymous |
| bool InitializeGLBindings(GLImplementation implementation) { |
| +#if defined(TOUCH_UI) |
| + base::AutoLock locked(g_lock); |
| +#endif |
| // Prevent reinitialization with a different implementation. Once the gpu |
| // unit tests have initialized with kGLImplementationMock, we don't want to |
| // later switch to another GL implementation. |