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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:50:43+00:00 2026-05-17T22:50:43+00:00

According the the MSDN documentation, Set() and Reset() on ManualResetEvent (or any EventWaitHandle) returns

  • 0

According the the MSDN documentation, Set() and Reset() on ManualResetEvent (or any EventWaitHandle) returns a boolean indicator whether or not the operation was successful.

Under which circumstances can this call return false, and what am I supposed to do if it does?

  • 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-17T22:50:44+00:00Added an answer on May 17, 2026 at 10:50 pm

    I wasn’t sure how to answer this and looking at a lot of MSDN examples the Set return value is ignored so it must not be important or likely to happen.

    But that wasn’t good enough. I fired up my VM and I opened up Reflector to take a look at the code. ManualResetEvent doesn’t have Set but it inherits from EventWaitHandle which does. Here’s the code:

    public bool Set()
    {
        bool flag = Win32Native.SetEvent(base.safeWaitHandle);
        if (!flag)
        {
            __Error.WinIOError();
        }
        return flag;
    }
    

    Where SetEvent is imported from Kernel32:

    [DllImport("kernel32.dll", SetLastError=true)]
    internal static extern bool SetEvent(SafeWaitHandle handle);
    

    The WinIOError() call just calls GetLastWin32Error which we don’t really care about. Basically this means for the call to return false, something pretty wrong would have had to have occurred in the Win32 native code.

    Putting this info together with the fact that code hosted in official MSDN documentation ignores the return value (why not? what are you going to do if the kernel fails anyway?) you can safely ignore it yourself if you want to clean your logic up a bit or get it and log it if you’re especially pedantic.

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

Sidebar

Related Questions

According to MSDN documentation it is not possible to set Socket.SendTimeout to a value
According to the msdn documentation : GetPictureFromObject method Returns a picture (Visual Basic Picture
According to MSDN documentation for RandomNumberGenerator : Application code does not directly use this
According to the MSDN documentation on the StringComparer.OrdinalIgnoreCase property: The OrdinalIgnoreCase property actually returns
I have set the ActiveDirectoryMembershipProvider connectionProtection attribute to secure, according to MSDN documentation states
According to MSDN Documentation for partial classes : Partial methods are implicitly private So
SQLCMD uses windows authentication by default. According to the MSDN documentation , you can
According to the HttpResponseMessage documentation on MSDN, the reason phrase (as in, the OK
According to MSDN BOL (Books Online) description on SOME | ANY (Transact-SQL) , SOME
According to the MSDN documentation , a ribbon:RibbonControlSizeDefinition can be used to control the

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.