From nobody  Thu Sep  4 16:59:26 1997
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
Subject: libc_r deviates from the pthread standard
X-Send-Pr-Version: www-1.0

>Number:         4470
>Category:       misc
>Synopsis:       libc_r deviates from the pthread standard
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    jb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep  4 17:00:00 PDT 1997
>Closed-Date:    Tue Apr 28 22:49:55 PDT 1998
>Last-Modified:  Tue Apr 28 22:51:44 PDT 1998
>Originator:     Carl Fongheiser
>Release:        3.0-CURRENT
>Organization:
>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.h>

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.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->jb 
Responsible-Changed-By: hoek 
Responsible-Changed-When: Sun Mar 22 21:14:23 PST 1998 
Responsible-Changed-Why:  
pthread stuff. 

jb -- tell me if I mistake one of these prs as "probably" fair to assign 
to you when it's not. 
State-Changed-From-To: open->closed 
State-Changed-By: jb 
State-Changed-When: Tue Apr 28 22:49:55 PDT 1998 
State-Changed-Why:  
sched_yield() has been added. 

Static initialisers for mutexes and condition variables have been 
added. 
>Unformatted:
