Poco

template < class M >

class ScopedLock

File Information

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.

Constructors

ScopedLock inline

explicit ScopedLock(
    M & mutex
);

ScopedLock inline

ScopedLock(
    M & mutex,
    long milliseconds
);

Destructor

~ScopedLock inline

~ScopedLock();