nine_bind didn't need atomics up to now,
because it's use what always within a protected
mutex. We need to use atomics because with the
next patches several threads may use nine_bind.
Signed-off-by: Axel Davy <axel.davy@ens.fr>
#include "pipe/p_compiler.h"
+#include "util/u_atomic.h"
#include "util/u_memory.h"
#include "guid.h"
static inline UINT
NineUnknown_Bind( struct NineUnknown *This )
{
- UINT b = ++This->bind;
+ UINT b = p_atomic_inc_return(&This->bind);
assert(b);
if (b == 1 && This->container) {
if (This->container != NineUnknown(This->device))
static inline UINT
NineUnknown_Unbind( struct NineUnknown *This )
{
- UINT b = --This->bind;
+ UINT b = p_atomic_dec_return(&This->bind);
if (!b) {
if (This->container) {
if (This->container != NineUnknown(This->device))