# class toLocker

This is a convenience class that holds a lock for the duration of the scope of the object. More...

Definition | `#include <tothread.h>`
List of all Methods

Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- toLocker (toLock &lock)
- ~toLocker ()

## Detailed Description

This is a convenience class that holds a lock for the duration of the scope of the object. It is very convenient to use if exceptions can be thrown, simply declare an auto toLocker to hold the lock. If any exception is thrown the locker will be deallocated and the lock released.

toLocker (toLock &lock)

### toLocker

Create locker.

Parameters:

lock | Lock to hold.

~toLocker ()

### ~toLocker