summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2015-05-09 16:22:33 +0300
committerFrancisco Jerez <[email protected]>2015-05-12 15:47:57 +0300
commit4022a468b2976c65e0d2afe9c9ac5804729e8641 (patch)
tree5473c26271e509cf0fbf40c8b1b24a9ed28594eb /src
parent2232b929fd9ca6f00c8dab9dc45c386986be922d (diff)
clover: Wrap event::_status in a method to prevent unlocked access.
Tested-by: Tom Stellard <[email protected]> CC: 10.5 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/clover/core/event.cpp15
-rw-r--r--src/gallium/state_trackers/clover/core/event.hpp4
2 files changed, 12 insertions, 7 deletions
diff --git a/src/gallium/state_trackers/clover/core/event.cpp b/src/gallium/state_trackers/clover/core/event.cpp
index d03e0b42ba3..969d19a54ae 100644
--- a/src/gallium/state_trackers/clover/core/event.cpp
+++ b/src/gallium/state_trackers/clover/core/event.cpp
@@ -27,7 +27,7 @@ using namespace clover;
event::event(clover::context &ctx, const ref_vector<event> &deps,
action action_ok, action action_fail) :
- context(ctx), _status(0), wait_count(1),
+ context(ctx), wait_count(1), _status(0),
action_ok(action_ok), action_fail(action_fail) {
for (auto &ev : deps)
ev.chain(*this);
@@ -84,6 +84,11 @@ event::signalled() const {
return !wait_count;
}
+cl_int
+event::status() const {
+ return _status;
+}
+
void
event::chain(event &ev) {
if (wait_count) {
@@ -122,8 +127,8 @@ cl_int
hard_event::status() const {
pipe_screen *screen = queue()->device().pipe;
- if (_status < 0)
- return _status;
+ if (event::status() < 0)
+ return event::status();
else if (!_fence)
return CL_QUEUED;
@@ -213,8 +218,8 @@ soft_event::soft_event(clover::context &ctx, const ref_vector<event> &deps,
cl_int
soft_event::status() const {
- if (_status < 0)
- return _status;
+ if (event::status() < 0)
+ return event::status();
else if (!signalled() ||
any_of([](const event &ev) {
diff --git a/src/gallium/state_trackers/clover/core/event.hpp b/src/gallium/state_trackers/clover/core/event.hpp
index f638c5bcf15..6469e483c73 100644
--- a/src/gallium/state_trackers/clover/core/event.hpp
+++ b/src/gallium/state_trackers/clover/core/event.hpp
@@ -66,7 +66,7 @@ namespace clover {
void abort(cl_int status);
bool signalled() const;
- virtual cl_int status() const = 0;
+ virtual cl_int status() const;
virtual command_queue *queue() const = 0;
virtual cl_command_type command() const = 0;
virtual void wait() const;
@@ -80,7 +80,6 @@ namespace clover {
protected:
void chain(event &ev);
- cl_int _status;
std::vector<intrusive_ref<event>> deps;
private:
@@ -88,6 +87,7 @@ namespace clover {
std::vector<intrusive_ref<event>> abort_self(cl_int status);
unsigned wait_count;
+ cl_int _status;
action action_ok;
action action_fail;
std::vector<intrusive_ref<event>> _chain;