This maybe sound strange to you but I\'m too lazy to write everytime like
if (threadAlive) { threadAlive = false; } else { th
Yes, there is!
threadAlive ^= true;
(this is a C# joke, in the most general case it won't work in C/C++/Javascript (it could work in C/C++/Javascript depending on some conditions), but it's true! ^ is the xor operator)
^