Static Public Member Functions | List of all members
Celartem::ThreadSafeOperation Struct Reference

#include <cel_syncobjs.h>

Static Public Member Functions

static size_t inc (volatile size_t *pNum)
 
static size_t dec (volatile size_t *pNum)
 
static size_t cmpxchg (size_t *dest, size_t xchg, size_t compare)
 
static void * cmpxchg_ptr (void **dest, void *xchg, void *compare)
 
static size_t xchg (size_t *dest, size_t val)
 
static void * xchg_ptr (void **dest, void *val)
 
static size_t xchg_add (size_t *dest, size_t incr)
 

Detailed Description

This struct provides functions of thread-safe interlocked increment decrement. Although the same operation could be done using Mutex instread of this class, the implementation of this class is faster than Mutex. Mutex

Member Function Documentation

static size_t Celartem::ThreadSafeOperation::cmpxchg ( size_t *  dest,
size_t  xchg,
size_t  compare 
)
static

InterlockedCompareExchange

static void* Celartem::ThreadSafeOperation::cmpxchg_ptr ( void **  dest,
void *  xchg,
void *  compare 
)
static

InterlockedCompareExchangePtr

static size_t Celartem::ThreadSafeOperation::dec ( volatile size_t *  pNum)
static

This function decrements the specified size_t variable.

Parameters
pNumPointer to the size_t variable.
Returns
The function returns the resulting decremented value.
static size_t Celartem::ThreadSafeOperation::inc ( volatile size_t *  pNum)
static

This function increments the specified size_t variable.

Parameters
pNumPointer to the size_t variable.
Returns
The function returns the resulting incremented value.
static size_t Celartem::ThreadSafeOperation::xchg ( size_t *  dest,
size_t  val 
)
static

InterlockedExchange

static size_t Celartem::ThreadSafeOperation::xchg_add ( size_t *  dest,
size_t  incr 
)
static

InterlockedExchangeAdd

static void* Celartem::ThreadSafeOperation::xchg_ptr ( void **  dest,
void *  val 
)
static

InterlockedExchangePtr


The documentation for this struct was generated from the following file:

Cuminas DjVu SDK 3.0.33103
This document is made with doxygen 1.8.5 at Sun Dec 15 2013 19:38:06.
Cuminas Logo