|
Boost Users : |
Subject: Re: [Boost-users] [shared_ptr] hangs on iPhone
From: Peter Dimov (pdimov_at_[hidden])
Date: 2009-11-26 11:55:38
Igor R wrote:
> Hello,
>
> My application works on iphone simulator, but hangs when running on
> iphone itself. Pausing it and looking at the stack trace shows the
> picture very similar to the one desribed here:
> http://article.gmane.org/gmane.comp.lib.boost.user/47644
> I.e., the call stack origins from different place each time, but ends
> up with an attempt to addref shared_ptr and spinning in the spinlock.
> I could try and use XCode "native" tr1::shared_ptr version, but
> boost::shared_ptr is used by many other boost libraries, so it
> wouldn't help.
> So my question is if there's any fix/workaround/compiler-switch that I
> can apply to overcome this issue and avoid re-writing the whole
> project without boost?
You might try to comment out the lines
#if defined(__GNUC__) && defined( __arm__ ) && !defined( __thumb__ )
# include <boost/smart_ptr/detail/spinlock_gcc_arm.hpp>
in smart_ptr/detail/spinlock.hpp and see if that helps... although it might
be better to investigate why the ARM spinlock doesn't work on the iPhone. Is
your application multithreaded, or does even a simple uncontended use of
boost::detail::spinlock or boost::detail::spinlock_pool fail? (Their tests
can be found in libs/smart_ptr/test.)
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