IPC@CHIP® RTOS-PPC – API Documentation

Header image

Main page

static DWORD atomicModify ( DWORD_ATOM ptr,
DWORD  mask,
DWORD  new_value 
) [inline, static]

This inline function provides a way to edit bits in a 32 bit memory location in a thread safe manner.

The function performed atomically here is:

DWORD atomicModify( DWORD_ATOM *ptr,
                    DWORD       mask, 
                    DWORD       new_value )
    DWORD newBits = mask & new_value ;
    *ptr = (*ptr & ~mask) | newBits ;
    return *ptr ;
ptr Location to be edited. This must be aligned on a DWORD boundary.
mask 1's mark bits to be edited
new_value Values under the mask are transfered into memory location.
New value after edit.
See also:
atomicAdd() atomicXor() atomicReset() atomicSet() atomicReadWrite()
This function is not available in the SC1x, SC2x and SC1x3 C-Library.
SC2x3 n/a - CLIB V1.02

Top of page | Main page

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