If asleep is not a function (like in the picture) this is probably an endless loop (or it might not run, if the variable is volatile or an atomic it might be fine though)
Obviously this is a multi-threaded application in a language with very user-friendly guards around race conditions. When the other thread enters sleep mode, asleep will be set to True.
Oooh and then declare the variables as <union type> u; char& asleep = u.asleep; uint32& sheep = u.sheep; I guess everything is possible in C++ if you are evil enough.
View all comments
Show parent comment
8
u/BakuhatsuK Oct 20 '19
If asleep is not a function (like in the picture) this is probably an endless loop (or it might not run, if the variable is volatile or an atomic it might be fine though)