Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 4 commits into from
Aug 29, 2024
Merged

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

merged 4 commits into from
Aug 29, 2024

Conversation

siren186
Copy link
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
43 checks passed
@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
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants