Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Atomic operation methods

The following table describes the methods provided for atomic operations:

Name Description

atomic

A statically-linked interface that provides fast atomic operations for the host and components.

atomic_Add

An atomic sum operation. Manages thread-safe reference counts of any object.

atomic_CompareAndExchange

Performs an atomic operation of:

if(*puDest == uCompare){*puDest = uExchange;}

Returns the previous value in *puDest.

atomic_CompareOrAdd

Performs an atomic operation of:

 if(*puDest != uCompare){*puDest += nAdd;}

Returns the new value in *puDest.

atomic_Exchange

Atomic exchange of 32-bit value. Performs an atomic operation of:

write uVal to *puDest

Returns the previous value in *puDest.

The following table provides information on the files required to use atomic methods:

Required Header Files
AEEAtomic.h
Header File Location
platform\cs\inc in the AMSS software
Required Libraries
AEEAtomic.h a1std and a1mod libraries, which provide standard library functions and code to allow OS Services to interface with the module.

a1_imp may also be needed. It provides access to library routines exported from a1, such as the atomic operations and debugging calls.

Library File Location
platform\cs\lib in the AMSS software, in the appropriate target directory.
Class ID(s)
None
Interface ID
None