This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: sizeof() segfault and mutex initialization?
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: Stefan Olsson <stefan at snon dot net>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Wed, 19 Feb 2003 23:23:32 -0600
- Subject: Re: sizeof() segfault and mutex initialization?
- References: <3E53788C.8040906@snon.net>
>_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