1 /* Yielding the processor to other threads and processes.
2 Copyright (C) 2005-2015 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3, or (at your option)
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, see <http://www.gnu.org/licenses/>. */
17 /* This file contains a primitive for yielding the processor to other threads.
18 extern void gl_thread_yield (void);
21 #ifndef _GLTHREAD_YIELD_H
22 #define _GLTHREAD_YIELD_H
26 /* ========================================================================= */
30 /* Use the POSIX threads library. */
38 # define gl_thread_yield() \
47 /* ========================================================================= */
51 /* Use the GNU Pth threads library. */
59 # define gl_thread_yield() \
68 /* ========================================================================= */
70 #if USE_SOLARIS_THREADS
72 /* Use the old Solaris threads library. */
80 # define gl_thread_yield() \
89 /* ========================================================================= */
91 #if USE_WINDOWS_THREADS
93 # define WIN32_LEAN_AND_MEAN /* avoid including junk */
100 # define gl_thread_yield() \
109 /* ========================================================================= */
111 #if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WINDOWS_THREADS)
113 /* Provide dummy implementation if threads are not supported. */
115 # define gl_thread_yield() 0
119 /* ========================================================================= */
121 #endif /* _GLTHREAD_YIELD_H */