MityDSP Documentation Index

Introduction

The tcDspAutoLCK class is used to provide a wrapper to a BIOS LCK to ensure the release of the lock when the tcDSPAutoLCK object goes out of scope.

Using this class makes the use of LCK objects more robust in terms of future maintenance and if C++ exceptions are thrown from any called functions.

See also:
MityDSP::tcDspAutoLCK Class Reference

Example

This is a simple example of using tcDspAutoLCK:

{
tcDspAutoLCK lock( handleOfYourLock );
...
}

Note that when the lock object goes out of scope, the destructor will call LCK_post to free the lock.

Using the tcDspAutoLCK class means that explicit calls to LCK_post are not needed on each and every return that might exist or be added in the future. The destructor will also be called if an exception is thrown.

You can declare the lock variable in local blocks within a function to control the scope for the lock.


  
Generated on Mon Apr 22 2013 11:33:02 for MityDSP Core by  Doxygen Version 1.8.1.1
Copyright © 2009, Critical Link LLC, All rights reserved.