DescriptionKeep lock during all of ScriptStreamer::fetchDataFromResourceBuffer.
This fixes a race condition where both the main thread and the V8 background
parsing thread call fetchDataFromResourceBuffer. The current lock makes sure
only one thread will fetch data from teh resourceBuffer at a time, and the
queue they put it in is natively thread safe, but - if threads race in just
the right way - the order might be reversed.
Example:
- thread 1 acquires lock, fetches data from resource buffer.
- thread 1 gets interruped; new data arrives in the resource buffer.
- thread 2 acquires lock, fetches data from resource buffer
- thread 2 adds its chunks to the data queue
- thread 1 adds its chunks to the data queue
-> the chunks are now queued in the wrong order.
BUG=510825
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=200990
Patch Set 1 #
Messages
Total messages: 10 (4 generated)
|