DotMP
Public Member Functions | Private Attributes | List of all members
DotMP.Lock Class Reference

A lock that can be used in a parallel region. Also contains instance methods for locking. Available methods are Set, Unset, and Test. More...

Public Member Functions

 Lock ()
 Constructs a new lock. More...
 
void Set ()
 Stalls the thread until the lock is set. More...
 
void Unset ()
 Unsets the lock. More...
 
bool Test ()
 Attempts to set the lock. Does not stall the thread. More...
 

Private Attributes

volatile int _lock
 The int acting as the lock. More...
 

Detailed Description

A lock that can be used in a parallel region. Also contains instance methods for locking. Available methods are Set, Unset, and Test.

Constructor & Destructor Documentation

◆ Lock()

DotMP.Lock.Lock ( )
inline

Constructs a new lock.

Member Function Documentation

◆ Set()

void DotMP.Lock.Set ( )
inline

Stalls the thread until the lock is set.

◆ Test()

bool DotMP.Lock.Test ( )
inline

Attempts to set the lock. Does not stall the thread.

Returns
True if the lock was set, false otherwise.

◆ Unset()

void DotMP.Lock.Unset ( )
inline

Unsets the lock.

Member Data Documentation

◆ _lock

volatile int DotMP.Lock._lock
private

The int acting as the lock.


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