It's time to revive this thread...
I am currently trying to implement the same as mentioned above: a loading screen and a thread loading the images in background. My current problem is a segfault I get when loading an Image (sf::Image::LoadFromFile) from the thread into a boost::ptr_map.
GDB outputs the following:
#0 0x00007ffff4d08669 in glGetIntegerv () from /usr/lib/libGL.so.1
#1 0x00007ffff794cd83 in sf::Image::GetMaximumSize() ()
from /usr/lib/libsfml-graphics.so.2.0
#2 0x00007ffff794ce38 in sf::Image::CreateTexture() ()
from /usr/lib/libsfml-graphics.so.2.0
#3 0x00007ffff794d544 in sf::Image::LoadFromFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
from /usr/lib/libsfml-graphics.so.2.0
#4 ...
This seems to be an OpenGL context error.
Did you change anything about loading images in different threads in SFML 2, Laurent? Or is it just my fault?
/edit: I try to do all this without a Mutex as it is not my intention to lock any thread. I just want them to run simultaneously. In the main thread I poll every tick whether the loading thread has finished, so I can continue my program. I do not need the synchronicity provided by a mutex and I want to avoid a deadlock.