Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 May 2008 06:36:52 -0400 (EDT)
From:      Daniel Eischen <deischen@freebsd.org>
To:        David Xu <davidxu@freebsd.org>
Cc:        freebsd-threads@freebsd.org
Subject:   Re: pthread_cleanup_push as a macro
Message-ID:  <Pine.GSO.4.64.0805310146030.21683@sea.ntplx.net>
In-Reply-To: <48408D5E.2010609@freebsd.org>
References:  <483FA1C0.2010506@freebsd.org> <200805301748.29689.jhb@freebsd.org> <Pine.GSO.4.64.0805301905020.20343@sea.ntplx.net> <48408D5E.2010609@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 31 May 2008, David Xu wrote:

> Daniel Eischen wrote:
>> On Fri, 30 May 2008, John Baldwin wrote:
>> 
>>> On Friday 30 May 2008 02:42:08 am David Xu wrote:
>>>> I would like to make pthread_cleanup_push and pthread_cleanup_pop as a
>>>> pair of macros, the current implementation has to malloc() and free() a
>>>> pthread_cleanup memory block everytime, this is slow, the new one
>>>> simply uses stack space, note that other OSes have already done it in
>>>> this way. The patch keeps old functions and should not have binary
>>>> compatible problem.
>>>> 
>>>> http://people.freebsd.org/~davidxu/patch/pthread_cleanup_push.patch
>>> 
>>> Please do!
>> 
>> I agree - Solaris does this too.  I am unsure why you really need
>> a strong_reference - I would prefer something that doesn't require
>> it.
>> 
>
> This becauses original _pthread_cleanup_push and _pthread_cleanup_pop are
> functions but not weak aliases, it is to keep compatibility.

Yes, but _pthread_cleanup_push and _pthread_cleanup_pop are still
functions, you are just adding _imp.  Are you afraid of _imp being
overridden (if it was a weak alias)?

I think another tool you could use is
__sym_default(__pthread_cleanup_pop_imp, _pthread_cleanup_pop, FBSD_1.1)

-- 
DE



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.64.0805310146030.21683>