Closed Bug 730079 Opened 8 years ago Closed 8 years ago

Move sCurrentGLContext to TLS to support off main thread GLDebug

Categories

(Core :: Graphics, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: BenWa, Assigned: BenWa)

References

Details

Attachments

(1 file, 2 obsolete files)

Attached patch patch (obsolete) — Splinter Review
No description provided.
Attachment #600147 - Flags: review?
Attachment #600147 - Flags: review? → review?(ajuma)
Blocks: omtc
Comment on attachment 600147 [details] [diff] [review]
patch

Review of attachment 600147 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/gl/GLContext.h
@@ +1476,5 @@
>      GLContextSymbols mSymbols;
>  
>  #ifdef DEBUG
> +    static Monitor sCurrentGLContextMonitor;
> +    static PRUintn sCurrentGLContextTLS;

Add a comment that we're using thread-local storage to track the GL context that's current for this thread.
Attachment #600147 - Flags: review?(ajuma) → review+
Can I get a +1 for the future-looking comment/message there ? ;-)
+1 for making me do work:

    // GLDebugMode will check that we don't send call
    // to a GLContext that isn't current on the current
    // thread.
    // Store the current context when binding to thread local
    // storage to support DebugMode on an arbitrary thread.
Attached patch patch v2 (obsolete) — Splinter Review
Assignee: nobody → bgirard
Attachment #600147 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #600171 - Flags: review+
You don't need to lock around access to thread-local storage.  It's thread local ;).
I'm looking to initialize the TLS index.
Attached patch patch v3Splinter Review
Attachment #600171 - Attachment is obsolete: true
Attachment #600542 - Flags: review?(joe)
Attachment #600542 - Flags: review?(joe) → review+
https://hg.mozilla.org/mozilla-central/rev/30af776a2988
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
No longer blocks: omtc
Blocks: omtc
You need to log in before you can comment on or make changes to this bug.