mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 20:08:06 +02:00
rusticl/event: ensure even status is updated in order
There was a race between the worker thread and flush, which could lead to the last event flushed getting its status set to CL_SUCCESS before any other event. Just wait on all flushed events in order to solve this. The current queue/event implementation isn't the best and we want to rework it, so this is good enough for now. Fixes:47a80d7ff4("rusticl/event: proper eventing support") Signed-off-by: Karol Herbst <git@karolherbst.de> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23578> (cherry picked from commitda4b27452b)
This commit is contained in:
parent
3ea2976e87
commit
ddcfd03212
2 changed files with 4 additions and 4 deletions
|
|
@ -2326,7 +2326,7 @@
|
|||
"description": "rusticl/event: ensure even status is updated in order",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "47a80d7ff4f966e3839640efd5f9d75e36af8906"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -82,14 +82,14 @@ impl Queue {
|
|||
|
||||
pub fn flush(&self, wait: bool) -> CLResult<()> {
|
||||
let mut p = self.pending.lock().unwrap();
|
||||
let last = p.last().cloned();
|
||||
let events = p.clone();
|
||||
// This should never ever error, but if it does return an error
|
||||
self.chan_in
|
||||
.send((*p).drain(0..).collect())
|
||||
.map_err(|_| CL_OUT_OF_HOST_MEMORY)?;
|
||||
if wait {
|
||||
if let Some(last) = last {
|
||||
last.wait();
|
||||
for e in events {
|
||||
e.wait();
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue