Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8511569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:02:04+00:00 2026-06-11T04:02:04+00:00

if this is a bug I have no problem just not doing it, but

  • 0

if this is a bug I have no problem just not doing it, but if this is an expected behaviour I would like to know why.

I do something like this:

{
   boost::lock_guard<boost::mutex> lg(tagsToSocketsMtx);
// mutex protected work 
   lg.~lock_guard(); // this causes deadlocks later(combined with ...
  //...other uses of the same mtx, ofc I use different lock guard in other functions)

// rest of the function
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T04:02:06+00:00Added an answer on June 11, 2026 at 4:02 am

    Once the construction of lg completes, C++ guarantees that its destructor will be called on scope exit regardless of the fact that you’re are also making an explicit destructor call.

    By destroying lg twice, you are invoking undefined behaviour, and in this case the bug manifests as a deadlock.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the weirdest bug! It is probably something silly, but I have no
I have some data, like this: BUG DATE STATUS ---- ---------------------- -------- 9012 18/03/2008
Can you help de-bug this program. I have it almost perfect but when I
I've built a few services in Delphi 7 and did not have this problem.
Not sure if this is C# 4+ specific, but just noticed this. Consider the
OK, I'm guessing that this might be a bug but I'm not totally sure.
We have this bug that only appears 30% of the time for the Release
I have recently discovered that I am affected by this bug http://www.mail-archive.com/mono-bugs@lists.ximian.com/msg71515.html Well, at
I have this supper weird bug, where this method fails in IE9. What is
I've got an issue with knockoutjs. I may be doing this completly wrong, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.