From owner-freebsd-current Tue Oct 29 8:48:12 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BAB7837B401 for ; Tue, 29 Oct 2002 08:48:10 -0800 (PST) Received: from wall.polstra.com (wall-gw.polstra.com [206.213.73.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 656CD43E75 for ; Tue, 29 Oct 2002 08:48:09 -0800 (PST) (envelope-from jdp@polstra.com) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.11.3/8.11.3) with ESMTP id g9TGlVx25374; Tue, 29 Oct 2002 08:47:31 -0800 (PST) (envelope-from jdp@vashon.polstra.com) Received: (from jdp@localhost) by vashon.polstra.com (8.12.5/8.12.5/Submit) id g9TGlVM5049992; Tue, 29 Oct 2002 08:47:31 -0800 (PST) (envelope-from jdp) Date: Tue, 29 Oct 2002 08:47:31 -0800 (PST) Message-Id: <200210291647.g9TGlVM5049992@vashon.polstra.com> To: current@freebsd.org From: John Polstra Cc: dfr@nlsystems.com Subject: Re: gnome on current In-Reply-To: <20021029141208.C97929-100000@herring.nlsystems.com> References: <20021029141208.C97929-100000@herring.nlsystems.com> Organization: Polstra & Co., Seattle, WA Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In article <20021029141208.C97929-100000@herring.nlsystems.com>, Doug Rabson 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 majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message