Skip to content

enh(ScopedLockWithUnlock): make it more alike std::unique_lock#4652

Merged
matejk merged 4 commits intopocoproject:mainfrom
siren186:feat/ScopedLockWithUnlock
Aug 29, 2024
Merged

enh(ScopedLockWithUnlock): make it more alike std::unique_lock#4652
matejk merged 4 commits intopocoproject:mainfrom
siren186:feat/ScopedLockWithUnlock

Conversation

@siren186
Copy link
Copy Markdown
Member

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.

@matejk matejk added this to the Release 1.14.0 milestone Aug 29, 2024
@siren186 siren186 requested a review from matejk August 29, 2024 10:43
@matejk matejk merged commit aa8084c into pocoproject:main Aug 29, 2024
@siren186 siren186 deleted the feat/ScopedLockWithUnlock branch August 30, 2024 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants