nge_atomic.c revision 6f3e57ac9d0b054c3169579f3422080b8ba10105
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* This file may contain confidential information of Nvidia
* and should not be distributed in source form without approval
* from Sun Legal.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "nge.h"
/*
* Atomically decrement a counter, but only if it will remain
* positive (>=0) afterwards.
*/
{
/* ATOMICALLY */
do {
if (oldval < n)
return (B_FALSE);
return (B_TRUE);
}
/*
* Atomically increment a counter
*/
void
{
/* ATOMICALLY */
do {
}
/*
* Atomically shift a 32-bit word left, returning
* the value it had *before* the shift was applied
*/
{
/* ATOMICALLY */
do {
return (oldval);
}