-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cxx-qt-gen: emit signals immediately #281
Conversation
This is a tricky one, I'll first have to read up a bit on the exact defnitions of safe/unsafe in Rust. We shouldn't be able to do something unsafe from safe code 🤔 |
What would be unsafe ? Eg how is this any different to calling a mutable function ? eg fn invokable(&mut self) {
self.field = 1;
myMutableFunction(); // <- this is the same as our signal? if is a ``mutable method so has the same borrowing rules
self.field = 2;
} |
The difference is just that most slots that are going to be connected to the signal will be implemented in C++ or QML (most likely). From the Rust book: We just have to trust that these functions have been written correctly. Interestingly, this brings up a problem that we might have in future, when we work on setting up signal and slot connections from Rust. Anyway, I'll proceed with the review. |
Now that we use a recursive mutex the chance of a deadlock is much lower and also defined behaviour. So remove the queued connection calls as now we can emit immediately.
Now that we use a recursive mutex the chance of a deadlock is much lower and also defined behaviour. So remove the queued emit signal calls as now we can emit immediately.
Instead use QTRY_COMPARE to wait for the value to change, as on some machines this may take more than one event loop.
7da227e
to
6250d6f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Now that we use a recursive mutex the chance of a deadlock
is much lower and also defined behaviour. So remove the queued
emit signal calls as now we can emit immediately.