This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: sizeof() segfault and mutex initialization?


>_S_thread_freelist_mutex = (__gthread_mutex_t*)malloc (sizeof 
>(__gthread_mutex_t));
>
>It's possible to do sizeof on structs defined inside the template class, 
>but not on for instance int or - what we really want to do - 
>__gthread_mutex_t. This seems to be the PR7112. Any work arounds?

Is __gthread_mutex_t a forward declaration or well defined at this point?
Does the size of __gthread_mutex_t change at any point? If not, do you
need to do this inside a templatized class?

7112 is fixed in mainline. If you are having problems, I suggest, as a
first step, posting a small, self-contained test case.

Again, think small.

>2) gthr does not implement a __gthread_mutex_init () function, only a 
>static initializer. However we need to create 1-n mutexes - one per bin 
>- during initialization code. How can this be done? Is it possible/ok to 
>call __gthread_objc_mutex_allocate?

Ouch. Loren?

-benjamin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]