poco
poco copied to clipboard
enh(ScopedLockWithUnlock): make it more alike std::unique_lock
void test_std()
{
std::mutex m;
std::unique_lock<std::mutex> guard(m);
guard.unlock(); // OK
guard.lock(); // OK
}
void test_poco()
{
Poco::Mutex m;
Poco::ScopedLockWithUnlock<Poco::Mutex> guard(m);
guard.unlock(); // OK
guard.lock(); // Failed !!!
}
This PR is to make Poco::ScopedLockWithUnlock
can lock/unlock for many time. Just same like std::unique_lock
do.