00001 /* 00002 * sched_yield wrapper 00003 * 00004 * $Id$ 00005 * 00006 * 00007 * 00008 * Copyright (C) 2001-2003 FhG Fokus 00009 * 00010 * Permission to use, copy, modify, and distribute this software for any 00011 * purpose with or without fee is hereby granted, provided that the above 00012 * copyright notice and this permission notice appear in all copies. 00013 * 00014 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 00015 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 00016 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 00017 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 00018 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 00019 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 00020 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 00021 */ 00022 /* 00023 * 00024 *History: 00025 *-------- 00026 * 2007-07-13 splitted from fastlock.h (andrei) 00027 */ 00028 00029 00030 #ifndef _sched_yield_h 00031 #define _sched_yield_h 00032 00033 #ifdef HAVE_SCHED_YIELD 00034 #include <sched.h> 00035 #else 00036 #include <unistd.h> 00037 /* fake sched_yield */ 00038 #ifndef sched_yield() 00039 #define sched_yield() sleep(0) 00040 #endif 00041 #endif 00042 00043 #endif /* _sched_yield_h */
1.7.1