Last Comment Bug 557671 - OpenGL Image Layers need thread safety
: OpenGL Image Layers need thread safety
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: Trunk
: x86 Windows 7
: -- normal with 1 vote (vote)
: ---
Assigned To: Bas Schouten (:bas.schouten)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-04-06 16:16 PDT by Bas Schouten (:bas.schouten)
Modified: 2011-10-07 09:45 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Add locks to OGL image layers (4.86 KB, patch)
2010-04-06 16:16 PDT, Bas Schouten (:bas.schouten)
no flags Details | Diff | Review
Add locks to OGL image layers v2 (4.21 KB, patch)
2010-04-06 16:58 PDT, Bas Schouten (:bas.schouten)
no flags Details | Diff | Review
Add locks to OGL image layers v3 (3.99 KB, patch)
2010-04-06 17:00 PDT, Bas Schouten (:bas.schouten)
roc: review+
Details | Diff | Review

Description Bas Schouten (:bas.schouten) 2010-04-06 16:16:51 PDT
Created attachment 437443 [details] [diff] [review]
Add locks to OGL image layers

YCbCr images should be threadsafe, SetData may be called on one thread while they are being drawn on another thread. Additionally SetCurrentImage and GetCurrentImage should lock while adding/releasing their references.

We upload cairo surface image bits from setdata which should always be called on the main thread, so we don't need locking in there for now.
Comment 1 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2010-04-06 16:17:52 PDT
(In reply to comment #0)
> Created an attachment (id=437443) [details]
> Add locks to OGL image layers
> 
> YCbCr images should be threadsafe, SetData may be called on one thread while
> they are being drawn on another thread.

This is actually not allowed. SetData must complete before you can call SetCurrentImage with that image.
Comment 2 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2010-04-06 16:19:34 PDT
So, remove the locking on the YCbCr images.

Also, use mozilla::Monitor instead of PR_ stuff.
Comment 3 Bas Schouten (:bas.schouten) 2010-04-06 16:58:45 PDT
Created attachment 437456 [details] [diff] [review]
Add locks to OGL image layers v2

Processed roc's comments.
Comment 4 Bas Schouten (:bas.schouten) 2010-04-06 17:00:05 PDT
Created attachment 437457 [details] [diff] [review]
Add locks to OGL image layers v3

Remove two useless includes.
Comment 5 Bas Schouten (:bas.schouten) 2011-10-07 09:45:33 PDT
http://hg.mozilla.org/mozilla-central/rev/afca4a8ad127

Note You need to log in before you can comment on or make changes to this bug.