| delorie.com/archives/browse.cgi | search |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| X-SWARE-Spam-Status: | No, hits=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_NONE |
| X-Spam-Check-By: | sourceware.org |
| X-RZG-AUTH: | :Ln4Re0+Ic/6oZXR1YgKryK8brksyK8dozXDwHXjf9xTKL3R4OlBCAU6/lWb5 |
| X-RZG-CLASS-ID: | mo00 |
| From: | Bruno Haible <bruno AT clisp DOT org> |
| To: | Dave Korn <dave DOT korn DOT cygwin AT googlemail DOT com>, cygwin AT cygwin DOT com |
| Subject: | Re: weak symbols on Cygwin |
| Date: | Thu, 8 Apr 2010 01:14:39 +0200 |
| User-Agent: | KMail/1.9.9 |
| Cc: | Eric Blake <eblake AT redhat DOT com> |
| References: | <4BBB31C6 DOT 7080703 AT redhat DOT com> <4BBCBADA DOT 2090504 AT gmail DOT com> <4BBCBB14 DOT 4080908 AT redhat DOT com> |
| In-Reply-To: | <4BBCBB14.4080908@redhat.com> |
| MIME-Version: | 1.0 |
| Message-Id: | <201004080114.41131.bruno@clisp.org> |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Id: | <cygwin.cygwin.com> |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sourceware.org/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
Dave Korn wrote:
>> I've got some code, written for ELF platforms, that detects whether the
>> pthread library (often a separate library from libc) is linked, by doing
>>
>> #pragma weak pthread_cancel
>> bool pthread_in_use = (pthread_cancel != NULL);
>
> And you really need to determine this dynamically at runtime rather than
> statically at configure time?
Sure. I want the same library (libintl) to be usable. on Unix,
1) by multithreaded programs, without bugs due to simultaneous access
to data by multiple threads,
2) by single-threaded programs, without putting on them the performance
price of linking with -lpthread.
"#pragma weak pthread_cancel" does exactly that.
Bruno
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |