WaitForSingleObject Behaviour RRS feed

  • Question


    Hey All,

    Hope this is the right group.

    I'm trying to find out the behaviour of WaitForSingleObject when the passed in handle is undefined (NULL or freed by another thread).  I haven't seen any article that explains the behaviour of the call in this case.  The reason I'm asking is I'm trying to track down a random crash in a multi-threaded application that makes it appear that my mutex is being ignored.


    Monday, September 22, 2008 5:10 PM


  • It will return (UINT)-1 or WAIT_ABANDONED, depending on the mishap.  GetLastError() is your friend.
    Hans Passant.
    • Marked as answer by Yan-Fei Wei Saturday, September 27, 2008 4:01 AM
    Tuesday, September 23, 2008 12:34 AM