id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 5372,spinlock fails on iPad2,Trantec@…,Peter Dimov,"Hi, I found an issue with the spinlock in spinlock_gcc.hpp. In our Project and in my testcode it doesn't work with multithreading on the iPad2 multicored arm processor. Here is the code which you can use to verify it: ----------- void doSomething(boost::weak_ptr weakp, int* number) { int i = 0; while(++i<10000) { { /* That works: the result is a number that equals to 40000*/ /*__sync_fetch_and_add(number, 1);*/ /* Here the result is a number much smaller then 40000*/ /*boost::detail::atomic_increment(number);*/ /* This crashes after some time since the use_count is becoming zero*/ /*boost::shared_ptr p=weakp.lock();*/ } } }*/ int main(int argc, char *argv[]) { int iNumber = 0; boost::shared_ptr p(new int(0)); boost::shared_array t; t.reset(new boost::thread[4]); for(size_t i=0; i<4; i++) { t[i] = boost::thread(boost::bind(&doSomething, p, &iNumber)); } t[0].join(); t[1].join(); t[2].join(); t[3].join(); } ------- If you got any questions, don't hasitate writing an email to me :) Greetings, Sascha",Bugs,closed,To Be Determined,smart_ptr,Boost 1.41.0,Showstopper,fixed,,