Catrobat.IDE.WindowsShared.Utilities.BSemaphore.WaitOne C# (CSharp) Method

WaitOne() public method

public WaitOne ( ) : bool
return bool
        public override bool WaitOne()
        {
            _ewh.WaitOne();
            OnSuccessfullWait();
            return true;
        }

Same methods

BSemaphore::WaitOne ( System.TimeSpan timeout ) : bool
BSemaphore::WaitOne ( int millisecondsTimeout ) : bool

Usage Example

        public static Task RunAsyncOnMainThread(Action action)
        {
            var semaphore = new BSemaphore(0, 1);

            ServiceLocator.DispatcherService.RunOnMainThread(async() =>
            {
                action.Invoke();
                semaphore.Release();
            });

            return(Task.Run(() => semaphore.WaitOne()));
        }
All Usage Examples Of Catrobat.IDE.WindowsShared.Utilities.BSemaphore::WaitOne