Skip to content

Commit

Permalink
fn rav1d_worker_task: Use read instead of try_read to fix conte…
Browse files Browse the repository at this point in the history
…ntion (#1207)
  • Loading branch information
randomPoison authored Jun 15, 2024
1 parent 0022862 commit ae1135d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/thread_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,9 @@ pub fn rav1d_worker_task(task_thread: Arc<Rav1dTaskContext_task_thread>) {
break 'found (fc, t_idx, prev_t);
}
} else if t.recon_progress != 0 {
let f = fc.data.try_read().unwrap();
// We need to block here because we are seeing rare
// contention.
let f = fc.data.read();
let p = t.type_0 == TaskType::EntropyProgress;
let error = fc.task_thread.error.load(Ordering::SeqCst);
let done = fc.task_thread.done[p as usize].load(Ordering::SeqCst);
Expand Down

0 comments on commit ae1135d

Please sign in to comment.