English 中文(简体)
远洋红外线向YES转变, 另一端 t见变化
原标题:One thread changes BOOL to YES, another thread doesn t see change

我有以下财产:

@property(assign) BOOL die;

如果要看这种变数是否变成了YES,那么就应该不断进行检查。 当这种死亡被定在YES(用一个用户点击ton子)时,另一个深.的透镜仍然认为是NO。 我通过该守则仔细追踪,并且认为,变数肯定没有显示经过修改。 这里正在发生什么?

每一个透镜是否含有自己变数的切身? 在 Java,用我的母语,我会给它写下挥发性的关键词,去掉当地对财产的read。

难道你可以做些什么,还是我错了吗?

最佳回答

不同的线索可能是检查不同的情况。 确保两条镜子都能获得该参数的同一拷贝。

问题回答

暂无回答




相关问题
Silverlight, Updating the UI during processing

I have a simple silverlight multifile upload application, and i want to provide the user with some feedback, right now its only in a test phase and i dont have the webservice. Somehow i cant get the ...

Is reading from an XmlDocument object thread safe?

I was wondering if i could safely read from an XmlDocument object using SelectNodes() and SelectSingleNode() from multiple threads with no problems. MSDN says that they are not guaranteed to be ...

Terminating a thread gracefully not using TerminateThread()

My application creates a thread and that runs in the background all the time. I can only terminate the thread manually, not from within the thread callback function. At the moment I am using ...

热门标签