Re: Invoking GTK main thread from other threads
- From: Daniel Boles <dboles src gmail com>
- To: gtkmm-list <gtkmm-list gnome org>
- Subject: Re: Invoking GTK main thread from other threads
- Date: Thu, 10 Sep 2020 18:35:45 +0100
That said, it's equally possible I am wrong and SignalIdle technically is not thread-safe. I can't really make sense of the wording in the docs...
for connect_once(), we have:
That makes enough sense and still leaves plenty cases for which it'll definitely be safe.
but for connect(), we have the unconditional:
I would expect the same condition(s) to apply to connect() as to connect_once() - since AFAIK, all the once version does is just disconnect itself automatically - but I might just be missing some obvious reason why this can't be the case. And now I feel like maybe I've had this discussion in the past...!
Anyway, I mentioned it because I have had the usual crashy behaviour symbolic of trying to access widgets in threads other than the main one, in my own projects, and wrapping the code doing said accesses in a lambda run in SignalIdle has always fixed it. Maybe I've just been lucky so far?
Thoughts/corrections to me from those more experienced at doing multi-threading with gtkmm are welcome.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]