# Poco

# template < class M >

# class ScopedLock

Library: Foundation
Package: Threading
Header: Poco/ScopedLock.h

## Description

A class that simplifies thread synchronization with a mutex. The constructor accepts a Mutex (and optionally a timeout value in milliseconds) and locks it. The destructor unlocks the mutex.

## Member Summary

Member Functions: operator =

## Constructors

### ScopedLock

ScopedLock() = delete;

### ScopedLock

explicit ScopedLock(
M & mutex
);

### ScopedLock

ScopedLock(
const ScopedLock & param372
) = delete;

### ScopedLock

ScopedLock(
M & mutex,
long milliseconds
);

### ScopedLock

ScopedLock(
M & mutex,
std::adopt_lock_t
);

Construct and assume already locked

## Destructor

### ~ScopedLock

~ScopedLock();

## Member Functions

### operator =

ScopedLock & operator = (
const ScopedLock & param373
) = delete;