From d4d74c5f56d312885acf59ce0981994eef8e3dba Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Wed, 19 May 2010 08:32:16 +0200 Subject: Add pthread_yield function * pthread/pt-yield.c: New file. * Makefile (SRCS): Add pt-yield.c * Makefile.am (libpthread_a_SOURCES): Add pt-yield.c --- include/pthread/pthread.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/pthread/pthread.h b/include/pthread/pthread.h index fbe3294..e6b9249 100644 --- a/include/pthread/pthread.h +++ b/include/pthread/pthread.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2002, 2005, 2006, 2007, 2008, 2009 +/* Copyright (C) 2000, 2002, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -734,6 +734,14 @@ extern int pthread_setschedparam (pthread_t thread, int policy, /* Set thread THREAD's scheduling priority. */ extern int pthread_setschedprio (pthread_t thread, int prio); + +#ifdef __USE_GNU +/* Yield the processor to another thread or process. + This function is similar to the POSIX `sched_yield' function but + might be differently implemented in the case of a m-on-n thread + implementation. */ +extern int pthread_yield (void); +#endif /* Kernel-specific interfaces. */ -- cgit v1.2.3