Base Module  VST 3.6.6
SDK for developing VST Plug-in
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions
FRwLock Class Reference

FRwLock - read / write lock. More...

#include <fthread.h>

Public Member Functions

 FRwLock (const char8 *name="FRwLock", bool writerPreference=false)
 FRwLock constructor. More...
 
 ~FRwLock ()
 FRwLock destructor. More...
 
bool verify ()
 Verifies lock. More...
 
void waitToRead ()
 Sets 'waits to read' state. More...
 
void doneReading ()
 Sets 'done reading' state. More...
 
void waitToWrite ()
 Sets 'wait to write' state. More...
 
void doneWriting ()
 Sets 'done writing' state. More...
 

Detailed Description

FRwLock - read / write lock.

Supports recursive locks from the same thread. Recursive read lock on a granted write lock is permitted. Recursive write lock on a granted write lock is permitted. Recursive write lock on a granted read lock is rejected. (unless the initial lock grant was a write request) Support selection of write preference and read preference.

Note
On modern OS write preference is implemented efficiently in the libraries, but it might result in deadlocks for nested reads from multiple threads.

Constructor & Destructor Documentation

FRwLock ( const char8 *  name = "FRwLock",
bool  writerPreference = false 
)

FRwLock constructor.

Parameters
namename of RwLock
writerPreferenceif true RwLock will choose a writer preference (new read arrivals block until the write request was fulfilled)
~FRwLock ( )

FRwLock destructor.

Member Function Documentation

bool verify ( )

Verifies lock.

Returns
true if locked.
void waitToRead ( )

Sets 'waits to read' state.

void doneReading ( )

Sets 'done reading' state.

void waitToWrite ( )

Sets 'wait to write' state.

void doneWriting ( )

Sets 'done writing' state.

Empty

Copyright ©2016 Steinberg Media Technologies GmbH. All Rights Reserved.