Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
CASDefine.h File Reference

Contains APIs and types for concurrent data structures. More...

#include <sese/Config.h>

Go to the source code of this file.

Classes

struct  sese::concurrent::Node< T >
 Node. More...
 

Namespaces

namespace  sese
 
namespace  sese::concurrent
 

Functions

bool compareAndSwapPointer (void *volatile *object, void *oldValue, void *newValue) noexcept
 Compares and swaps two pointers.
 

Detailed Description

Contains APIs and types for concurrent data structures.

Author
Kaoru
Date
May 31, 2022

Function Documentation

◆ compareAndSwapPointer()

bool compareAndSwapPointer ( void *volatile * object,
void * oldValue,
void * newValue )
inlinenoexcept

Compares and swaps two pointers.

* if( *object == oldValue ) {
*   *object = newValue;
*   return true;
* } else {
*   return false;
* }
* 
Parameters
objectThe object to be compared
oldValueThe original value
newValueThe value to be set
Returns
Whether the operation was successful