clover: Add a mutex to guard queue::queued_events
authorTom Stellard <thomas.stellard@amd.com>
Thu, 7 May 2015 13:57:14 +0000 (13:57 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Mon, 11 May 2015 18:52:18 +0000 (18:52 +0000)
commitf546902d9597429713c83e2caf6b69856bd7ba4d
tree82ec75df7964205cafaf40ac1a048ff5b4cb9b3a
parent73f4010082cf0fc2fe34c59e2eb5801eed10762b
clover: Add a mutex to guard queue::queued_events

This fixes a potential crash where on a sequence like this:

Thread 0: Check if queue is not empty.
Thread 1: Remove item from queue, making it empty.
Thread 0: Do something assuming queue is not empty.

CC: 10.5 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/gallium/state_trackers/clover/core/queue.cpp
src/gallium/state_trackers/clover/core/queue.hpp