This would be done without mutexes. I just want to know if it is thread safe ie the program will not crash or something similar. I do not really care that the variable could be in the wrong state when it is read as the consequence is not fatal (only impact would be making a copy of a small data structure when not necessary) I am using Qt.
Here is the context that could happen: from the main thread, I would be setting a bool that is a member of a qthread. While or after I am setting the bool to true, the qthread could be in the function that uses this bool (this is a function that is used by the main thread and the qthread, everything is already protected and synchronised so as to not have the function being run by both threads simultaneously)
Kinda think of it, since this bool is only used by the main thread anyways I will check which thread is in the function and that should solve that but I am still curious.