From owner-p4-projects@FreeBSD.ORG Sat Nov 20 04:44:09 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2489A16A4D0; Sat, 20 Nov 2004 04:44:09 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 01AE616A4CE for ; Sat, 20 Nov 2004 04:44:09 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E4FCB43D2F for ; Sat, 20 Nov 2004 04:44:08 +0000 (GMT) (envelope-from davidxu@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id iAK4i8Jq006469 for ; Sat, 20 Nov 2004 04:44:08 GMT (envelope-from davidxu@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id iAK4i8Ab006466 for perforce@freebsd.org; Sat, 20 Nov 2004 04:44:08 GMT (envelope-from davidxu@freebsd.org) Date: Sat, 20 Nov 2004 04:44:08 GMT Message-Id: <200411200444.iAK4i8Ab006466@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to davidxu@freebsd.org using -f From: David Xu To: Perforce Change Reviews Subject: PERFORCE change 65515 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Nov 2004 04:44:09 -0000 http://perforce.freebsd.org/chv.cgi?CH=65515 Change 65515 by davidxu@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(); }