PDA

View Full Version : AboutToHide, why isn't it a race condition?



tescrin
3rd December 2012, 18:41
[Disclaimer: I assume that Signals/Slots are asynchronous (or is this not the default?) I know you *can* make them asynchronous..]

Either way, it would seem the "AboutToHide" signal and their ilk (AboutToShow, others?) would signal any classes listening and if they didn't respond fast enough they'd miss their chance. That said, I've never had any issues using this signal or similar ones.

What am I missing? Is this just a race condition with an acceptably low chance of missing the object before it closes/opens? Is there some code produced that waits for code blocks utilizing AboutToHide-style signals to reach their end before closing the Dialog/Menu/whatever?

Thank you for any help/discussion

amleto
3rd December 2012, 18:53
they are synchronous by default unless a signal/slot jumps a thread

wysota
3rd December 2012, 18:53
[Disclaimer: I assume that Signals/Slots are asynchronous (or is this not the default?) I know you *can* make them asynchronous..]

Either way, it would seem the "AboutToHide" signal and their ilk (AboutToShow, others?) would signal any classes listening and if they didn't respond fast enough they'd miss their chance.
Only if you deliberately shoot yourself in your foot by making connections to those signals queued (which doesn't make sense in this particular case).