libstdc++: Only use __gthread_yield if gthreads is available

libstdc++-v3/ChangeLog:

	* include/std/mutex (__lock_impl): Check
	_GLIBCXX_HAS_GTHREADS before using __gthread_yield.
This commit is contained in:
Matheus Castanho 2021-07-09 15:13:38 +01:00 committed by Jonathan Wakely
parent 7802ee7b01
commit 2e345e4ad6

View File

@ -618,7 +618,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return;
}
}
#ifdef _GLIBCXX_USE_SCHED_YIELD
#if defined _GLIBCXX_HAS_GTHREADS && defined _GLIBCXX_USE_SCHED_YIELD
__gthread_yield();
#endif
constexpr auto __n = 1 + sizeof...(_L1);