In article <[EMAIL PROTECTED]>,
Doug Rabson  <[EMAIL PROTECTED]> wrote:
> On Tue, 29 Oct 2002, John Polstra wrote:
> > I think it would work if the symbol were defined strongly in libc_r.
> 
> I think so too. I was trying to work out why this wasn't how things were
> done already. FWIW, linux's libpthread appears to be defining the
> pthread_* symbols strongly.

I think the weak symbols have something to do with support for thread
cancellation.  I didn't pay much attention at the time, so I don't
know the details.  Here's the relevant commit message, I think (this
one taken from lib/libc_r/uthread/uthread_pause.c):

  date: 2001/01/24 13:03:34;  author: deischen;  state: Exp;  lines: +4 -4
  Add weak definitions for wrapped system calls.  In general:

          _foo - wrapped system call
          foo - weak definition to _foo

  and for cancellation points:

          _foo - wrapped system call
          __foo - enter cancellation point, call _foo(), leave
                  cancellation point
          foo - weak definition to __foo

  Change use of global _thread_run to call a function to get the
  currently running thread.

  Make all pthread_foo functions weak definitions to _pthread_foo,
  where _pthread_foo is the implementation.  This allows an application
  to provide its own pthread functions.

  Provide slightly different versions of pthread_mutex_lock and
  pthread_mutex_init so that we can tell the difference between
  a libc mutex and an application mutex.  Threads holding mutexes
  internal to libc should never be allowed to exit, call signal
  handlers, or cancel.

  Approved by:    -arch

John
-- 
  John Polstra
  John D. Polstra & Co., Inc.                        Seattle, Washington USA
  "Disappointment is a good sign of basic intelligence."  -- Chögyam Trungpa


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to