lkml.org 
[lkml]   [2013]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 09/11] liblockdep: support using LD_PRELOAD
On 02/07/2013 05:28 AM, Jamie Iles wrote:
>> +int pthread_rwlock_init(pthread_rwlock_t *rwlock,
>> > + const pthread_rwlockattr_t *attr)
>> > +{
>> > + if (ll_pthread_rwlock_init == NULL)
>> > + init_preload();
> Why is this one special, doesn't init_preload being a constructor make
> this redundant?

I was testing it on different things, and stumbled on an interesting case:
when pthread_mutex was taken from the constructor of a different module.

In that case, the other constructor would try to init the mutex and take
a lock, but we would segfault because we haven't resolved the pthread
symbols yet ourselves (since our constructor was yet to be called).


Thanks,
Sasha


\
 
 \ /
  Last update: 2013-02-07 16:21    [W:0.229 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site