Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Race condition in callInMainThreadHelper (Read 2507 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.
Microsoft Windows: We can't script here, this is bat country.

 

Re: Race condition in callInMainThreadHelper

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