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 896369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:43:07+00:00 2026-05-15T14:43:07+00:00

There is scenario, I have two threads both are using same mutex. One thread

  • 0

There is scenario, I have two threads both are using same mutex. One thread locked the mutex and crashed. What would be the mutex state? Is it still locked and second thread never own that mutex? Means a deadlock situation?

Edit – Also explain a case of pthread on Linux systems

  • 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-05-15T14:43:08+00:00Added an answer on May 15, 2026 at 2:43 pm

    Since you haven’t specified what OS, I’ll tell you what happens in Win32.

    In Win32, the second thread would get WAIT_ABANDONED when it goes to wait on the mutex owned by a thread that has terminated. Note that receiving WAIT_ABANDONED means the second thread has received the mutex, so there won’t be a deadlock. The second thread should detect the WAIT_ABANDONED result and verify that the resource protected by the mutex is in a valid state. If it can detect corruption and does not detect any, it is safe to proceed. If not, it’s a good idea to raise an error of some sort.

    With some implementations of a mutex there is no way to detect that the thread owning it has terminated, and you end up with a deadlock.

    With some implementations of a mutex there is a way to detect what the owning thread is, figure out that the owning thread has terminated, and then take ownership of the mutex.

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

Sidebar

Related Questions

Simply scenario -- I have two buttons both of which call the same controller/action.
I have two distinct scenarios. One, where there is a many to many case,
Imagine the following scenario: I have two classes in a one-to-many relationship and I
Scenario I have a Windows Forms Application. Inside the main form there is a
I have a ASP.NET MVC 3 app with a common scenario where there is
I have a simple producer/consumer scenario, where there is only ever a single item
So lets say I have the following scenario. http://website.com:8080 and http://website.com:8080/demo Is there any
I often come across a scenario where I have two collections of objects (either
I'm wondering if there's a way in Java to synchronize using two lock objects.
I have the following SQL problem. Scenario: I have two tables: Change and ChangeTicket.

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.