clover: Fix a bug with multi-threaded events v2
authorTom Stellard <thomas.stellard@amd.com>
Thu, 26 Mar 2015 19:33:24 +0000 (19:33 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Mon, 11 May 2015 18:52:29 +0000 (18:52 +0000)
commit9c4dc98b298c74015f2a7c21571bccf0a5b6cc98
tree2f4d848248f96b9e6e98073d16993e90ab09d819
parentf546902d9597429713c83e2caf6b69856bd7ba4d
clover: Fix a bug with multi-threaded events v2

It was possible for some events never to get triggered if one thread
was creating events and another threads was waiting for them.

This patch consolidates soft_event::wait() and hard_event::wait()
into event::wait() so that hard_event objects will now wait for
all their dependencies to be submitted before flushing the command
queue.

v2:
  - Rename variables
  - Use mutable varibales so we can keep event::wait() const
  - Open code signalled() call so mutex can be atted to signalled
    without deadlocking.

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