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?


On Wed, Feb 19, 2003 at 01:29:00PM +0100, Stefan Olsson wrote:
> 
> 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.

Okay.

> Is it possible/ok to call __gthread_objc_mutex_allocate?

No/no.  They aren't available to C++.  But we can define one ourselves,
or maybe (doubtful) add one to the gthr-*.h files.

> How can this be done?

You can do a malloc followed by __GTHREAD_MUTEX_INIT_FUNCTION.  Look at
the messy code I just committed to config/cpu/generic/atomicity.h and the
bottom of src/misc-inst.cc for how some of that works.


Phil

-- 
I would therefore like to posit that computing's central challenge, viz. "How
not to make a mess of it," has /not/ been met.
                                                 - Edsger Dijkstra, 1930-2002


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