Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Networking With Open Transport / Part 2 - Open Transport Reference
Chapter 27 - Utilities Reference / Functions
Atomic Operations /


OTAtomicAdd8

Atomically adds an 8-bit value to a memory location.

C INTERFACE
SInt8 OTAtomicAdd8  (SInt32 toAdd,
                     SInt8* where)
C++ INTERFACE
None. C++ applications use the C interface to this function.

PARAMETERS
toAdd
A signed 8-bit value to add to the value referenced by the where parameter.
where
A pointer to a signed 8-bit value that is added to the value specified by the parameter toAdd.
function result
The sum of the values specified by the function's parameters.
DISCUSSION
This function atomically adds the least significant 8 bits of toAdd to the value referenced by the where parameter and returns the result. It also stores the result in the location referenced by the where parameter.

You can use this function to subtract the toAdd value from the value referenced by the where parameter by reversing the sign of toAdd.

Use the OTAtomicAdd32 function to add two 32-bit values.

Use the OTAtomicAdd16 function to add two 16-bit values.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 JAN 1998