From owner-freebsd-bugs Thu Sep 4 17:00:03 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id RAA02367 for bugs-outgoing; Thu, 4 Sep 1997 17:00:03 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.7/8.8.7) id RAA02355; Thu, 4 Sep 1997 17:00:02 -0700 (PDT) Resent-Date: Thu, 4 Sep 1997 17:00:02 -0700 (PDT) Resent-Message-Id: <199709050000.RAA02355@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, cmf@netins.net Received: (from nobody@localhost) by hub.freebsd.org (8.8.7/8.8.7) id QAA02296; Thu, 4 Sep 1997 16:59:26 -0700 (PDT) Message-Id: <199709042359.QAA02296@hub.freebsd.org> Date: Thu, 4 Sep 1997 16:59:26 -0700 (PDT) From: cmf@netins.net To: freebsd-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: www-1.0 Subject: misc/4470: libc_r deviates from the pthread standard Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Number: 4470 >Category: misc >Synopsis: libc_r deviates from the pthread standard >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Sep 4 17:00:00 PDT 1997 >Last-Modified: >Originator: Carl Fongheiser >Organization: >Release: 3.0-CURRENT >Environment: FreeBSD kf0yn.ampr.org 3.0-CURRENT FreeBSD 3.0-CURRENT #1: Thu Jul 3 23:12:41 C DT 1997 cmf@kf0yn.ampr.org:/usr/src/sys/compile/OSITOS i386 >Description: The function called pthread_yield() is actually called sched_yield() in the standard. This is pointed out in the errata to "Programming with Threads", found at http://sunsite.queensu.ca/sunmicro/sunpress/threads/errata.html Also, the PTHREAD_*_INITIALIZER definitions are part of the public interface, and thus should not be squirreled away in pthread_private.h in the library sources. >How-To-Repeat: Compile the following program. Compare to a compliant system. #include pthread_mutex_t dummy_mutex = PTHREAD_MUTEX_INTIALIZER; void *thread_func(void *); main() { pthread_thread_t my_thread; pthread_create(&my_thread, NULL, thread_func, NULL); pthread_join(my_thread); } void *thread_func(void *thread_param) { for (;;) sched_yield(); } >Fix: Rename pthread_yield(), and move structure and initializer definitions out of pthread_private.h, and into pthread.h. >Audit-Trail: >Unformatted: