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 8356955

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:20:16+00:00 2026-06-09T10:20:16+00:00

I have a mutex created with CreateMutex , and then I use WaitForSingleObject to

  • 0

I have a mutex created with CreateMutex, and then I use WaitForSingleObject to wait on some thread until such time that the Mutex is released and take ownership of it (with no timeout).

So, if the function returns WAIT_OBJECT_0, I can go on my marry way and execute the threads’ code.

However, in case the function returns WAIT_ABANDONED, can I still execute the code, expecting that any other thread calling WaitForSingleObject on my Mutex is going to get stuck until I release?


In case the owning thread terminates without releasing the Mutex, I want the calling thread to take ownership and things to keep going as usual.


EDIT: what is confusing to me is that MSDN says the state of the mutex in case (2) is unsignaled as opposing to state (1) where it is signaled. What does that mean for me?

  • 0 0 Answers
  • 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-09T10:20:19+00:00Added an answer on June 9, 2026 at 10:20 am

    If you get WAIT_ABANDONED back, that means you have taken ownership of the mutex. The problem is that you don’t know the state of the resource that is being protected by it.

    For example, let’s say Thread X gets a mutex and starts manipulating the state of something protected by that mutex, and then gets killed. The state is unknown and the mutex is unheld. When you go to wait on that mutex, you will receive it, but you won’t know that state.

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

Sidebar

Related Questions

Is if almost always required to have thread syncing (i.e. use of mutex, semaphores,
I have currently created a C++ class for a thread safe integer which simply
I am working on a network programming and I have created a thread pool.
I'd like to know how are mutex created on Linux? I figured out, that
I have created an office scheduling program that uses jQuery to post to a
I have several sections of code that I need to protect with a Mutex.
my program runs as a service or with console. I have created a System.Threading.Mutex
I have an application that creates a thread, and it will be listening for
In linux, why can't we have a mutex inside an isr() routine for protecting
I have the following code: def query(self,query): lock = QMutexLocker(self.mutex) reply = self.conn.query(query) if

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.