| 1 |
# sched_yield.m4 |
| 2 |
# serial 3 |
| 3 |
dnl Copyright (C) 2019-2025 Free Software Foundation, Inc. |
| 4 |
dnl This file is free software; the Free Software Foundation |
| 5 |
dnl gives unlimited permission to copy and/or distribute it, |
| 6 |
dnl with or without modifications, as long as this notice is preserved. |
| 7 |
dnl This file is offered as-is, without any warranty. |
| 8 |
|
| 9 |
AC_DEFUN([gl_FUNC_SCHED_YIELD], |
| 10 |
[ |
| 11 |
AC_REQUIRE([gl_SCHED_H_DEFAULTS]) |
| 12 |
AC_REQUIRE([gl_PTHREADLIB]) |
| 13 |
AC_REQUIRE([AC_CANONICAL_HOST]) |
| 14 |
|
| 15 |
if { case "$host_os" in mingw* | windows*) true;; *) false;; esac; } \ |
| 16 |
&& test $gl_threads_api = windows; then |
| 17 |
dnl Choose function names that don't conflict with the mingw-w64 winpthreads |
| 18 |
dnl library. |
| 19 |
REPLACE_SCHED_YIELD=1 |
| 20 |
else |
| 21 |
AC_CHECK_DECL([sched_yield], , [HAVE_SCHED_YIELD=0], |
| 22 |
[[#include <sched.h>]]) |
| 23 |
fi |
| 24 |
]) |