Subject: Re: __libc_mutex initialization
To: Nathan J. Williams <nathanw@wasabisystems.com>
From: Hiramatsu Yoshifumi <hiramatu@boreas.dti.ne.jp>
List: current-users
Date: 06/18/2004 06:08:14
At Wed, 16 Jun 2004 13:34:58 -0400,
"Nathan J. Williams" <nathanw@wasabisystems.com> wrote:
> The reason this was done was to permit the continued use of
> third-party packages that implement versions of the pthread_*
> functions, such as pth and ptl2. 

Do you mean "pthread_* functions shouldn't appear unless libpthread.so is loaded" ?

If so, I really meant is code like below. Is this so different what you are saying?
Am I misunderstanding something?

pthread_init()
{
  ...
  __libc_mutex_init = pthread_mutex_init;
  __libc_mutec_lock = pthread_mutex_lock;
  ...
  __isthreaded = 1;
}

> It may be worth investigating a mechanism whereby a program or library
> that includes the system pthread.h header is guaranteed to get the
> libc/libpthread versions, however (such as a set of #define's in the
> system pthread.h).

I want a mechanism which ensures __libc_mutex functions are system's
pthread_mutex functions when __isthreaded = 1...

-- 
// Hiramatsu Yoshifumi
// hiramatu@boreas.dti.ne.jp