summaryrefslogtreecommitdiffstats
path: root/src/gallium/include/pipe
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2009-04-17 18:40:46 +0100
committerJosé Fonseca <[email protected]>2009-04-17 18:40:46 +0100
commit86ed894e47bae10d158f2b4a02065daa9dbe5194 (patch)
tree83d461520a00ddac7ee01d168b150a9303e78ce7 /src/gallium/include/pipe
parent90c880f08996cce57273544d8ba11b56ce2a06f3 (diff)
pipe: Get the p_atomic_dec_zero logic right this time.
Diffstat (limited to 'src/gallium/include/pipe')
-rw-r--r--src/gallium/include/pipe/p_atomic.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gallium/include/pipe/p_atomic.h b/src/gallium/include/pipe/p_atomic.h
index ed5f665512d..0c3fbae428c 100644
--- a/src/gallium/include/pipe/p_atomic.h
+++ b/src/gallium/include/pipe/p_atomic.h
@@ -225,7 +225,7 @@ p_atomic_cmpxchg(struct pipe_atomic *v, int32_t old, int32_t _new)
struct pipe_atomic
{
- long count;
+ volatile long count;
};
#define p_atomic_set(_v, _i) ((_v)->count = (_i))
@@ -234,7 +234,7 @@ struct pipe_atomic
static INLINE boolean
p_atomic_dec_zero(struct pipe_atomic *v)
{
- return InterlockedDecrement(&v->count) != 0;
+ return InterlockedDecrement(&v->count) == 0;
}
static INLINE void
@@ -270,7 +270,6 @@ p_atomic_cmpxchg(struct pipe_atomic *v, int32_t old, int32_t _new)
* Add an assembly port instead. It may abort and
* doesn't destroy used mutexes.
*/
-#warning "using mutex-based fallback for pipe_atomic"
struct pipe_atomic {
pipe_mutex mutex;