[Mesa-dev] [PATCH] os: Check for spurious wakeups in pipe_barrier_wait.
Brian Paul
brianp at vmware.com
Tue Apr 20 09:36:21 PDT 2010
Vinson Lee wrote:
> I would like this to be reviewed before it is committed.
>
> The current implementation and this patch doesn't address the potential
> existing case where count is erroneously initialized with zero.
> That can be a separate patch.
Do you mean add assert(count > 0) in pipe_barrier_init() or something
else?
> os: Check for spurious wakeups in pipe_barrier_wait.
>
> Add a 64-bit counter that is incremented whenever the barrier becomes full. A woken thread
> checks the counter. If the counter has not changed then it has been
> spuriously woken and goes back to sleep. If the counter has changed then it was properly
> signaled and exits the barrier.
I'm not sure I understand the problem.
Can you give an example of how we'd get a spurious wake-up signal?
-Brian
More information about the mesa-dev
mailing list