clover: Reduce wait_count in abort path.
authorJan Vesely <jan.vesely@rutgers.edu>
Wed, 25 Jul 2018 02:17:28 +0000 (22:17 -0400)
committerJan Vesely <jan.vesely@rutgers.edu>
Thu, 26 Jul 2018 19:38:22 +0000 (15:38 -0400)
Trigger waiter condition variable.
Passes 'events' CTS on carrizo and turks.
v2: reduce to 0

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/gallium/state_trackers/clover/core/event.cpp

index b7eb33dbfc8ce938be7d884030d75d841e230e73..3d313ce89694ce2c40b861bc3eb02d2afe396c0a 100644 (file)
@@ -41,7 +41,7 @@ event::trigger_self() {
    std::lock_guard<std::mutex> lock(mutex);
    std::vector<intrusive_ref<event>> evs;
 
-   if (!--_wait_count)
+   if (_wait_count && !--_wait_count)
       std::swap(_chain, evs);
 
    cv.notify_all();
@@ -65,8 +65,10 @@ event::abort_self(cl_int status) {
    std::vector<intrusive_ref<event>> evs;
 
    _status = status;
+   _wait_count = 0;
    std::swap(_chain, evs);
 
+   cv.notify_all();
    return evs;
 }