Binarysharp.MemoryManagement.Threading.ThreadCore.WaitForSingleObject C# (CSharp) Method

WaitForSingleObject() public static method

Waits an infinite amount of time for the specified object to become signaled.
public static WaitForSingleObject ( SafeMemoryHandle handle ) : WaitValues
handle Binarysharp.MemoryManagement.Native.SafeMemoryHandle A handle to the object.
return WaitValues
        public static WaitValues WaitForSingleObject(SafeMemoryHandle handle)
        {
            // Check if the handle is valid
            HandleManipulator.ValidateAsArgument(handle, "handle");

            // Wait for single object
            var ret = NativeMethods.WaitForSingleObject(handle, 0xFFFFFFFF);

            // If the function failed
            if (ret == WaitValues.Failed)
                throw new Win32Exception("The WaitForSingleObject function call failed.");

            return ret;
        }

Same methods

ThreadCore::WaitForSingleObject ( SafeMemoryHandle handle, System.TimeSpan timeout ) : WaitValues

Usage Example

 /// <summary>
 ///     Blocks the calling thread until a thread terminates or the specified time elapses.
 /// </summary>
 /// <param name="time">The timeout.</param>
 /// <returns>The return value is a flag that indicates if the thread terminated or if the time elapsed.</returns>
 public WaitValues Join(TimeSpan time)
 {
     return(ThreadCore.WaitForSingleObject(Handle, time));
 }
All Usage Examples Of Binarysharp.MemoryManagement.Threading.ThreadCore::WaitForSingleObject