IPC@CHIP® RTOS-PPC – API Documentation

Header image

Main page


static DWORD atomicReadWrite ( DWORD_ATOM ptr,
DWORD  value 
) [inline, static]

This inline function provides a way to test and write to a 32 bit memory location in a thread safe manner.

This can be used to accomplish either a "Test and Set" or a "Test and Clear" operation.

The function performed atomically here is:

DWORD atomicReadWrite( DWORD_ATOM *ptr, DWORD  value)
{
    DWORD valueWas = *ptr ;
    *ptr = value ;
    return valueWas ;
}
Parameters:
ptr Location to be written. This must be aligned on a DWORD boundary.
value Value to write
Returns:
valueWas - Value at location before this write was performed.
See also:
atomicAdd() atomicXor() atomicModify() atomicReset() atomicWrite()
Compatibility:
This function is not available in the SC1x, SC2x and SC1x3 C-Library.
Since:
SC2x3 n/a - CLIB V1.03





Top of page | Main page

Copyright © 2017 Beck IPC GmbH
Generated on Thu Jan 26 16:21:38 2017 by Doxygen 1.6.1