C3D Toolkit  Kernel - 108943, Vision - 2.3.6.36
tool_mutex.h File Reference

Locks implementation on base of system synchronization mechanisms and OpenMP locks. details Implementation of locks (including scoped lock) on base of system synchronization mechanisms and OpenMP locks.
. More...

#include <math_define.h>

Classes

class  CommonMutex
 Lock class. More...
 
class  ParallelRegionGuard
 Scoped guard of parallel region. More...
 
class  ScopedLock
 Scoped lock. Can accept a null pointer to a mutex. Locking occurs if the pointer to the mutex is nonzero and the code runs in parallel. More...
 
class  ScopedRecursiveLock
 Recursive scoped lock. Can accept a null pointer to a mutex. Locking occurs if the pointer to the mutex is nonzero and the code runs in parallel. More...
 
class  MbSyncItem
 Base synchronization object with lazy initialization. More...
 
class  MbNestSyncItem
 Base synchronization object with lazy initialization which supports nested locks. More...
 
class  MbPersistentSyncItem
 Base object providing means of synchronization. More...
 
class  MbPersistentNestSyncItem
 Base synchronization object with support of nested locks. More...
 

Macros

#define CommonRecursiveMutex   CommonMutex
 Same implementation of CommonMutex and CommonRecursiveMutex.
 
#define ENTER_PARALLEL(useParallel)   if ( useParallel ) EnterParallelRegion();
 If useParallel == true, notifies the kernel about entering a parallel region. More...
 
#define EXIT_PARALLEL(useParallel)   if ( useParallel ) ExitParallelRegion();
 If useParallel == true, notifies the kernel about exiting a parallel region. More...
 

Functions

void EnterParallelRegion ()
 The function notifies the kernel about entering a parallel region. The function call should be placed before the start of a parallel block.
 
void ExitParallelRegion ()
 The function notifies the kernel about exiting a parallel region. The function call should be placed after the end of the parallel block.
 
bool IsInParallel ()
 The function determines whether the code is executed in parallel.
 

Detailed Description

Locks implementation on base of system synchronization mechanisms and OpenMP locks. details Implementation of locks (including scoped lock) on base of system synchronization mechanisms and OpenMP locks.
.

Macro Definition Documentation

◆ ENTER_PARALLEL

#define ENTER_PARALLEL (   useParallel)    if ( useParallel ) EnterParallelRegion();

If useParallel == true, notifies the kernel about entering a parallel region.

If useParallel == true, notifies the kernel about entering a parallel region. The call should be placed before the start of a parallel block (before OpenMP pragma). Using a macro speeds up parallel OpenMP cycles significantly.

◆ EXIT_PARALLEL

#define EXIT_PARALLEL (   useParallel)    if ( useParallel ) ExitParallelRegion();

If useParallel == true, notifies the kernel about exiting a parallel region.

If useParallel == true, notifies the kernel about exiting a parallel region. The call should be placed after the end of the parallel block. Using a macro speeds up parallel OpenMP cycles significantly.