template class Poco::ScopedLockWithUnlock

Overview

A class that simplifies thread synchronization with a mutex. Moreā€¦

#include <ScopedLock.h>

template <class M>
class ScopedLockWithUnlock
{
public:
    // construction

    ScopedLockWithUnlock(M& mutex);

    ScopedLockWithUnlock(
        M& mutex,
        long milliseconds
        );

    // methods

    void
    unlock();
};

Detailed Documentation

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. The unlock() member function allows for manual unlocking of the mutex.