With GCC 4.8.2 (on Linux/Debian/Sid 64 bits) -or GCC 4.9 when available - in C++11- I have some mutex
std::mutex gmtx;
actually, it is
Try atomic (e.g. atomic or atomic), which has a nice load function that will do what you want, as well as other nice functions like compare_exchange_strong.
atomic