Skip to main content
Topic: Race condition in callInMainThreadHelper (Read 169 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Race condition in callInMainThreadHelper

I think I discovered a race condition in the callInMainThreadHelper. It only ensures that the object required for the callback is alive until just before the callback executes. So the object could still get destroyed after the check and before the execution of the callback or during the execution of the callback.

I assume this is a sensible place to report this, @Peter?

Re: Race condition in callInMainThreadHelper

Reply #1
Thanks for the insight.

The object assumes that its lifetime ends in the main thread - it even has an assert() for this in its shutdown routine. So its destruction can't interfere with execution of the callbacks.

I'll add extra documentation to make this clear.

 

Re: Race condition in callInMainThreadHelper

Reply #2
Thanks for the clarification – I missed the assert.

 
SimplePortal 1.0.0 RC1 © 2008-2019