linux-mips
[Top] [All Lists]

atomic_add_negative?

To: linux-mips@linux-mips.org
Subject: atomic_add_negative?
From: Brad Bozarth <prettygood@cs.stanford.edu>
Date: Fri, 18 Oct 2002 15:51:46 -0700 (PDT)
Original-recipient: rfc822;linux-mips@linux-mips.org
Reply-to: prettygood@cs.stanford.edu
Sender: linux-mips-bounce@linux-mips.org
The current atomic.h says this is not implemented for mips...  would this 
work - modeled after the rest of the atomic_blah_and_test ?

/*
 * atomic_add_negative - add and test if negative
 * @v: pointer of type atomic_t
 * @i: integer value to add
 *
 * Atomically adds @i to @v and returns true
 * if the result is negative, or false when
 * result is greater than or equal to zero.  Note that the guaranteed
 * useful range of an atomic_t is only 24 bits.
 */
#define atomic_add_negative(i,v) (atomic_add_return(i, (v)) < 0)


<Prev in Thread] Current Thread [Next in Thread>
  • atomic_add_negative?, Brad Bozarth <=