This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Why __gthread_active_p() is checked only in few functions?
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: niXman <i dot nixman at autistici dot org>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Tue, 30 Sep 2014 11:39:17 +0100
- Subject: Re: Why __gthread_active_p() is checked only in few functions?
- Authentication-results: sourceware.org; auth=none
- References: <34ce7e306e6f583704fbafe4c0b040bc at autistici dot org> <CAH6eHdQyHv73J__Cdr+PJr0btVJm4rk2oQLt4=kq+RhuLZUH4A at mail dot gmail dot com> <e6d6bda579af5c68d0e06b8fcd284f5e at autistici dot org> <CAH6eHdRbhGGCuN1OxiSNS-f=KnLG0pzrNCfZzayptTTDBQ9S3g at mail dot gmail dot com> <96870e661bc4ef0cca84f30af454c055 at autistici dot org>
On 30 September 2014 11:17, niXman wrote:
> Jonathan Wakely 2014-09-30 13:22:
>
>> I mean exactly what I wrote.
>>
>> __gthread_mutex_lock is a one-line function that forwards to
>> pthread_mutex_lock. Using GNU libc if you don't link to libpthread.so
>> then pthread_mutex_lock is a no-op function that does nothing. It is
>> quicker to just call it than to spend time checking if threads are
>> active.
>
>
> Ok, but what about '__gthread_mutex_init_function()'?
What part of my first answer wasn't clear? Do I just need to say the
same thing again using different words?