PrevUpHomeNext

esv::ydzs


Experience is the best teacher.

esv::ydzs

esv::ydzs, aka yield-this-thread, is used to yield this thread, which will call std::this_thread::yield. esv::ydzs() is a shorthand of std::this_thread::yield().

c++ example

#include <esvcpp/thread.hpp>
#include <esvcpp/core.hpp>

int main()
{
	auto f1 = esv::async(
		[]
		{
			for (esv::ix32 i=0; i<10; ++i)
			{
				esv::print(i);
				esv::ydzs();
			}
		}
	);
}

See Also

esv::async

esv::deferred

esv::mutex0~9

esv::print


PrevUpHomeNext

esv::print