Bug 148957

Summary: Static variables in GraphicsContext3DOpenGLCommon should be avoided because of the race condition
Product: WebKit Reporter: Jinyoung Hur <hur.ims>
Component: Layout and RenderingAssignee: Jinyoung Hur <hur.ims>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, dino, kondapallykalyan, noam, roger_fong
Priority: P2    
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Jinyoung Hur 2015-09-08 08:40:04 PDT
There is no guarantee that only one thread calls GraphicsContext3D::compileShader() at a time so it would be 
better to use a thread local storage variable rather than use a static variable.

In my case, the race condition is occurred when multiple instances of TextureMapperShaderProgram are created on each other thread and 
the constructors of TextureMapperShaderProgram call GraphicsContext3D::compileShader() simultaneously.
Comment 1 Jinyoung Hur 2015-09-08 08:47:42 PDT
Created attachment 260761 [details]
Patch
Comment 2 WebKit Commit Bot 2015-09-10 11:48:07 PDT
Comment on attachment 260761 [details]
Patch

Clearing flags on attachment: 260761

Committed r189580: <http://trac.webkit.org/changeset/189580>
Comment 3 WebKit Commit Bot 2015-09-10 11:48:12 PDT
All reviewed patches have been landed.  Closing bug.