PERFORCE change 65515 for review
David Xu
davidxu at FreeBSD.org
Fri Nov 19 20:44:09 PST 2004
http://perforce.freebsd.org/chv.cgi?CH=65515
Change 65515 by davidxu at davidxu_alona on 2004/11/20 04:44:01
call __sys_sched_yield.
Affected files ...
.. //depot/projects/davidxu_thread/src/lib/libthread/thread/thr_yield.c#2 edit
Differences ...
==== //depot/projects/davidxu_thread/src/lib/libthread/thread/thr_yield.c#2 (text+ko) ====
@@ -40,34 +40,12 @@
int
_sched_yield(void)
{
- struct pthread *curthread = _get_curthread();
-
- if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM)
- return (__sys_sched_yield());
-
- /* Reset the accumulated time slice value for the current thread: */
- curthread->slice_usec = -1;
-
- /* Schedule the next thread: */
- _thr_sched_switch(curthread);
- /* Always return no error. */
- return(0);
+ return (__sys_sched_yield());
}
/* Draft 4 yield */
void
_pthread_yield(void)
{
- struct pthread *curthread = _get_curthread();
-
- if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) {
- __sys_sched_yield();
- return;
- }
-
- /* Reset the accumulated time slice value for the current thread: */
- curthread->slice_usec = -1;
-
- /* Schedule the next thread: */
- _thr_sched_switch(curthread);
+ __sys_sched_yield();
}
More information about the p4-projects
mailing list