id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 6931,mutex waits forwever with Intel C++ Compiler XE 12.1.5.344 Build 20120612,Orin Eman ,viboes,"The following in thread/win32/thread_primitives.hpp doesn't work with the latest Intel Compiler and the /debug:parallel option: inline bool interlocked_bit_test_and_set(long* x,long bit) { __asm { mov eax,bit; mov edx,x; lock bts [edx],eax; setc al; }; } inline bool interlocked_bit_test_and_reset(long* x,long bit) { __asm { mov eax,bit; mov edx,x; lock btr [edx],eax; setc al; }; } The Intel Compiler is immediately following the ""setc al;"" instructions with ""mov eax, esp"", trashing the return value. I'll report the problem to Intel, but I'm pretty sure that they will say that the behaviour the above code relies on isn't guaranteed by any compiler. The fix is simple: inline bool interlocked_bit_test_and_set(long* x,long bit) { bool ret; __asm { mov eax,bit; mov edx,x; lock bts [edx],eax; setc al; mov ret, al }; return ret; } inline bool interlocked_bit_test_and_reset(long* x,long bit) { bool ret; __asm { mov eax,bit; mov edx,x; lock btr [edx],eax; setc al; mov ret, al }; return ret; } Let the compiler optimize out the extra move should it so desire... Orin.",Bugs,closed,Boost 1.52.0,thread,Boost 1.51.0,Problem,fixed,mutex intel compiler,