System.Threading.Thread.Yield C# (CSharp) Метод

Yield() публичный статический Метод

public static Yield ( ) : bool
Результат bool
        public static bool Yield()
        {
            throw null;
        }

Usage Example

Пример #1
0
        public void SearchCacheDoesntHoldTheBuffer()
        {
            var vimBuffer = CreateVimBuffer();

            vimBuffer.TextBuffer.SetText("hello world");
            vimBuffer.Process("/world", enter: true);

            // This will kick off five search items on the thread pool, each of which
            // has a strong reference. Need to wait until they have all completed.
            var count = 0;

            while (count < 5)
            {
                while (_synchronizationContext.PostedCallbackCount > 0)
                {
                    _synchronizationContext.RunOne();
                    count++;
                }

                Thread.Yield();
            }

            var weakTextBuffer = new WeakReference(vimBuffer.TextBuffer);

            // Clean up
            vimBuffer.TextView.Close();
            vimBuffer = null;

            RunGarbageCollector();
            Assert.Null(weakTextBuffer.Target);
        }
All Usage Examples Of System.Threading.Thread::Yield