Looks indeed like an issue in the OS X implementation. Time to wait for Hirua's comment.
Two points about your code:
* bool is not an atomic type and operations on it require synchronization as well, or you use the C++11 atomic symbols.
* Keep in mind that std::hash's hashing algorithm is compiler/toolchain specific and it's not always very good.
Thanks for the feedback, I didn't know about the hash being compiler/toolchain specific. I just used that because I googled how to print the current thread id and I thought it was the proper way of doing it in C++11. Anyway, I just wanted to print unambiguously each thread.
I kept the exitThreadFlag simple for the sake of the minimal example. Although the behavior of reading/writing concurrently the same bool is not defined, as far as I understand, for this example in the worst case you'd be running 1 extra iteration within the loop, which doesn't seem to be a ver big problem in this case. But yes, in case you're doing more complicated things and even if you're not a purist coder, you'd better protect every shareable zone with something to avoid race conditions.
Hey Hey, thanks for the *proper* bug report. It's not everyday I get something that clear about a bug. So let's focus on the issue at hand and not digress on opinion based topic about MT programming, shall we? :-)
BTW, to debug things, use your debugger, it's way faster since you don't need to edit code to add prints. In this case, I added breakpoints in releasePool() and retainPool() that automatically continue executing code after executing bt -c 0 (print only the header of the backtrace) and I get the following:
You're welcome. Thanks for the advice and for working to figure out the workaround
. The thing is that I didn't have the SFML project loaded into my IDE (so that I can debug with it, as I have no idea of using gdb manually) and wasn't setting correctly the breakpoints. Also, I come from the embedded software world where most of the times you cannot really debug in real-time, so I'm used to prepare some logs the moment I have any issue debugging. In any case, you're right, it's way faster to use the debug, because it also provides you with tons of information quite complex to gather of any other way. I'd rather had invested some time importing the project into my IDE, though
BTW, the sf::Shader::isAvailable() trick works like a charm, thanks a million.