1 /* Yielding the processor to other threads and processes.
2 Copyright (C) 2005-2011 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, write to the Free Software Foundation,
16 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
18 /* This file contains a primitive for yielding the processor to other threads.
19 extern void gl_thread_yield (void);
22 #ifndef _GLTHREAD_YIELD_H
23 #define _GLTHREAD_YIELD_H
27 /* ========================================================================= */
31 /* Use the POSIX threads library. */
39 # define gl_thread_yield() \
48 /* ========================================================================= */
52 /* Use the GNU Pth threads library. */
60 # define gl_thread_yield() \
69 /* ========================================================================= */
71 #if USE_SOLARIS_THREADS
73 /* Use the old Solaris threads library. */
81 # define gl_thread_yield() \
90 /* ========================================================================= */
100 # define gl_thread_yield() \
109 /* ========================================================================= */
111 #if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WIN32_THREADS)
113 /* Provide dummy implementation if threads are not supported. */
115 # define gl_thread_yield() 0
119 /* ========================================================================= */
121 #endif /* _GLTHREAD_YIELD_H */