Appendices > Portable Thread Library > Threads > Yielding the Current Thread
 
Yielding the Current Thread
Sometimes, you might want a thread to yield so that any other waiting threads can be scheduled immediately. This is often the case if one thread is waiting for another thread to do something without blocking —e.g. a call to IlsBarrier::wait or IlsCond::wait would cause the thread to block.
An example of this function is shown below:
while (someCondition()) {
  IlsThread::Yield();
}

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.