![]() |
1
3
显而易见的答案是你有多个
即使
有几种方法可以进行调查。
|
![]() |
2
3
按照@JoshKelley的建议,使用unique_ptr为我解决了问题。 所以我把注意力转移到boost::shared_ptr上,以了解问题所在。事实证明,使用标志boost_AC_USE_PTHREADS和boost_SP_USE_PTHEREADS为iOS构建boost是出现这种奇怪现象的最初原因。基于: 1) Andy Weinstein的回答: Boost threads: in IOS, thread_info object is being destructed before the thread finishes executing 2) 弱序CPU教程( http://preshing.com/20121019/this-is-why-they-call-it-a-weakly-ordered-cpu/ ) 很明显,我应该使用Spin Lock,即BOOST_SP_USE_SPINLOCK标志来构建BOOST。 在我用boost_SP_USE_SPINLOCK标志重建了boost之后,问题似乎得到了解决。 |
![]() |
3
2
下面的代码说明了一个工作示例。它使用
|