Boost logo

Boost Users :

From: Christopher Hunt (huntc_at_[hidden])
Date: 2005-07-29 18:28:35


>> When UTFStringHolder is instantiated, I get an EXC_BAD_ACCESS and my
>> stack trace shows that pthread_mutex_init is being called. Here's the
>> complete stack trace:
>>
>> #0 0x90012730 in _pthread_mutex_init
>> #1 0x00088424 in boost::detail::lightweight_mutex::lightweight_mutex()
>> at lwm_pthreads.hpp:47
>
> These things usually happen when you have inconsistent definitions of
> BOOST_HAS_THREADS in the source files or libraries that form your
> program.
> Does the code still fail when you try it as a single self-contained
> source
> file? If it does, can you post a minimal example that fails?
Unfortunately it is not reproducible in a single self-contained file...
which is interesting isn't it...

Also, I've managed successfully to have a shared_array member as part
of another class's instantiation. The only difference that I see is the
timing of when they're instantiated.

Could it be anything to do with the initialisation of my pthread
environment? (what initialises pthreads?) I'll do some experiments
around this. If it is of interest, this is all being done in a Mac OS X
Cocoa Objective-C environment. Cocoa likes to know when it is going
multi-threaded
(http://developer.apple.com/documentation/Cocoa/Conceptual/
Multithreading/articles/CocoaDetaching.html) and I do let it know, but
maybe I should let it know earlier.

Thanks for your help. I'll do some more experimentation around the
timing of instantiation.

Cheers,
-C


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net